Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cast value with asXxx #466

Closed
wey-gu opened this issue Aug 23, 2022 · 2 comments
Closed

cast value with asXxx #466

wey-gu opened this issue Aug 23, 2022 · 2 comments

Comments

@wey-gu
Copy link
Contributor

wey-gu commented Aug 23, 2022

ref vesoft-inc/nebula-python#222

This will be handy for users to get the wrapped value with one go.

@Nicole00
Copy link
Contributor

No need to wrap a cast function in Java.
If we provide this function:

    public Object cast(ValueWrapper valueWrapper){
        if(valueWrapper.isNull()){
            return null;
        }else if(valueWrapper.isString()){
            return valueWrapper.asString();
        }else if(valueWrapper.isLong()){
            return valueWrapper.asLong();
        }else if{}
        ...
    }

Then user get an Object, and when they need to get the object's datatype, they still need to judge the Object's class type.
So they can just write the cast function to get the Value's specific class type.

@wey-gu
Copy link
Contributor Author

wey-gu commented Oct 26, 2022

ok :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants