You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To build a Attribute the building block for the constructor is a Label. Until now the constructor requires a string that isn't given by the function calling the constructor. Excuse the ending txt in the pinned file. But GitHub didn't support .jl files. AttributeType.txt
The text was updated successfully, but these errors were encountered:
Just include the code instead of the textfile if it isn't too long.
# This file is a part of TypeDBClient. License is MIT: https://github.com/Humans-of-Julia/TypeDBClient.jl/blob/main/LICENSEstruct AttributeType{V} <:AbstractAttributeType
label::Label
is_root::Boolend# More convenient for referenceconst VALUE_TYPE = Proto.AttributeType_ValueType
# Encode the value type (as defined in VALUE_TYPE) in the type parameterfunctionAttributeType(label::Label, is_root::Bool, value_type::EnumType)
AttributeType{value_type}(label, is_root)
end# Define conversion functionsletfunction_as_something(value_type::EnumType)
returnfunction(t::AttributeType{V}) where {V}
t.is_root ||throw(TypeDBClientException(INVALID_CONCEPT_CASTING, V))
returnAttributeType(Label("attribute"), true, value_type)
endendglobal as_boolean =_as_something(VALUE_TYPE.BOOLEAN)
global as_long =_as_something(VALUE_TYPE.LONG)
global as_double =_as_something(VALUE_TYPE.DOUBLE)
global as_string =_as_something(VALUE_TYPE.STRING)
global as_date_time =_as_something(VALUE_TYPE.DATETIME)
endproto(::AttributeType{V}) where {V} = V
#TODO What is Object value type in Java? It needs to return `false` for that.is_writable(::AttributeType) =trueis_writable(::AttributeType{VALUE_TYPE.OBJECT}) =falseis_keyable(::AttributeType) =falseis_keyable(::AttributeType{VALUE_TYPE.LONG}) =true
To build a Attribute the building block for the constructor is a Label. Until now the constructor requires a string that isn't given by the function calling the constructor. Excuse the ending txt in the pinned file. But GitHub didn't support .jl files.
AttributeType.txt
The text was updated successfully, but these errors were encountered: