Class ArcheTextValue
java.lang.Object
com.blackrook.archetext.ArcheTextValue
The values stored in an
ArcheTextObject.- Author:
- Matthew Tropiano
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionabsolute()Returns the absolute value of this value, returning a new one.Returns the bitwise "not" value of this value, returning a new one.combineWith(Combinator combinator, ArcheTextValue source) Combines this value with another and returns the result.copy()static <T> ArcheTextValuecreate(T object) Creates a new value.<T> TcreateForType(String memberName, Class<T> type) Converts this value to another Java object type.booleanequals(ArcheTextValue other) Equality test.booleangetType()getValue()inthashCode()booleanisNull()Returns if this object is null-valued.negate()Negates the value of this value, returning a new one.not()Returns the logical "not" value of this value, returning a new one.promoteTo(ArcheTextValue.Type promotionType) Returns a new ArcheTextValue that is a promoted type from this one.toString()
-
Field Details
-
NULL
Null value.
-
-
Method Details
-
create
Creates a new value. Converts primitives and boxed primitives, strings, arrays, andSets, andMaps, and objects.- Type Parameters:
T- the object's type.- Parameters:
object- the input object.- Returns:
- an
ArcheTextValueto use inArcheTextObject.
-
createForType
-
hashCode
-
equals
-
equals
Equality test.- Parameters:
other- the other value.- Returns:
- true if equal, false if not.
-
copy
- Returns:
- a deep copy of this value.
-
getType
- Returns:
- the value type.
-
getValue
- Returns:
- the value itself.
-
isNull
public boolean isNull()Returns if this object is null-valued.- Returns:
- true if so, false if not.
-
combineWith
Combines this value with another and returns the result.- Parameters:
combinator- the combinator to use.source- the source value to combine this with. Can be null forNULL.- Returns:
- the new value.
-
promoteTo
Returns a new ArcheTextValue that is a promoted type from this one. No types can be promoted toArcheTextValue.Type.OBJECT. If the same type is passed in, this object is returned.- Parameters:
promotionType- the type to promote to.- Returns:
- the new, promoted value.
- Throws:
ArcheTextOperationException- if the type is less than this one or not promotable.
-
negate
Negates the value of this value, returning a new one. Only works for integers, floats, and strings (strings are set to lower case).- Returns:
- a new value.
- Throws:
ArcheTextOperationException- if the current type is not a correct type.
-
not
Returns the logical "not" value of this value, returning a new one. Only works for booleans.- Returns:
- a new value.
- Throws:
ArcheTextOperationException- if the current type is not a correct type.
-
bitwiseNot
Returns the bitwise "not" value of this value, returning a new one. Only works for booleans, integers, and floats.- Returns:
- a new value.
- Throws:
ArcheTextOperationException- if the current type is not a correct type.
-
absolute
Returns the absolute value of this value, returning a new one. Only works for integers, floats, and strings (strings are set to upper case).- Returns:
- a new value.
- Throws:
ArcheTextOperationException- if the current type is not a correct type.
-
toString
-