Package dev.siroshun.codec4j.api.io
Interface Type
- All Known Subinterfaces:
Type.NumberValue<T>,Type.Value<T>
- All Known Implementing Classes:
Type.BooleanValue,Type.ByteValue,Type.CharValue,Type.DoubleValue,Type.FloatValue,Type.IntValue,Type.ListType,Type.LongValue,Type.MapType,Type.ShortValue,Type.StringValue,Type.Unknown
@NotNullByDefault
public sealed interface Type
permits Type.ListType, Type.MapType, Type.Unknown, Type.Value<T>
An interface providing basic types that are supported by Codec4J.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classAType.Valuetype forBoolean.static final classAType.Valuetype forByte.static final classAType.Valuetype forCharacter.static final classAType.Valuetype forDouble.static final classAType.Valuetype forFloat.static final classAType.Valuetype forInteger.static final classATypefor a list.static final classAType.Valuetype forLong.static final classATypefor a map.static interfaceAType.Valuetype forNumbers.static final classAType.Valuetype forShort.static final classAType.Valuetype forString.static final classATypefor an unknown type.static interfaceAn interface indicating thatTypeisType.Value. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Type.BooleanValuestatic final Type.ByteValuestatic final Type.CharValuestatic final Type.DoubleValuestatic final Type.FloatValuestatic final Type.IntValuestatic final Type.ListTypeATypefor a list.static final Type.LongValuestatic final Type.MapTypeATypefor a map.static final Type.ShortValuestatic final Type.StringValuestatic final Type.UnknownAn unknownType. -
Method Summary
Modifier and TypeMethodDescriptiondefault booleanWhether thisTypeis aType.BooleanValuetype.default booleanisList()Whether thisTypeis aType.ListTypetype.default booleanisMap()Whether thisTypeis aType.MapTypetype.default booleanisNumber()Whether thisTypeis aType.NumberValuetype.default booleanisString()Whether thisTypeis aType.StringValuetype.default booleanWhether thisTypeis anType.Unknowntype.static List<Type.NumberValue<?>> Gets aListof allType.NumberValues.types()static List<Type.Value<?>> Gets aListof allType.Values.
-
Field Details
-
Method Details
-
types
-
knownTypes
- Returns:
- a
Listof all knownTypes, excludingType.Unknowntype
-
valueTypes
Gets aListof allType.Values.- Returns:
- a
Listof allType.Values
-
numberTypes
Gets aListof allType.NumberValues.- Returns:
- a
Listof allType.NumberValues
-
isBoolean
default boolean isBoolean()Whether thisTypeis aType.BooleanValuetype.- Returns:
trueif thisTypeis aType.BooleanValuetype, otherwisefalse
-
isNumber
default boolean isNumber()Whether thisTypeis aType.NumberValuetype.- Returns:
trueif thisTypeis aType.NumberValuetype, otherwisefalse
-
isString
default boolean isString()Whether thisTypeis aType.StringValuetype.- Returns:
trueif thisTypeis aType.StringValuetype, otherwisefalse
-
isList
default boolean isList()Whether thisTypeis aType.ListTypetype.- Returns:
trueif thisTypeis aType.ListTypetype, otherwisefalse
-
isMap
default boolean isMap()Whether thisTypeis aType.MapTypetype.- Returns:
trueif thisTypeis aType.MapTypetype, otherwisefalse
-
isUnknown
default boolean isUnknown()Whether thisTypeis anType.Unknowntype.- Returns:
trueif thisTypeis anType.Unknowntype, otherwisefalse
-