- Type Parameters:
T- The Java type associated with this type.
Type interface and delegates the calls to another Type implementation.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopyOf()<V> TypeFielddeclareField(String name, Class<V> type, Function<T, V> function) Field declaration with aFunctionas value reader.final booleanMethod returns ALL known fields, both explicitly declared and resolved.Returns a declared field with the given name.final intgetId()Each type is assigned a unique auto-increment int identifier which developers can use in SPI implementations, for example in sharding/partitioning data collections.final StringThere can be only one Type with the given name, but there could be many types associated with a specific Java Class.final StringgetName()final inthashCode()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.evrete.api.Type
declareBooleanField, declareDoubleField, declareIntField, declareLongField
-
Constructor Details
-
TypeWrapper
-
-
Method Details
-
getDelegate
-
getId
public final int getId()Description copied from interface:TypeEach type is assigned a unique auto-increment int identifier which developers can use in SPI implementations, for example in sharding/partitioning data collections.
-
getJavaType
Description copied from interface:TypeThere can be only one Type with the given name, but there could be many types associated with a specific Java Class. This method returns the associated Java type.
- Specified by:
getJavaTypein interfaceType<T>- Returns:
- name of the Java Class associated with the type.
-
resolveJavaType
- Specified by:
resolveJavaTypein interfaceType<T>
-
getName
-
getDeclaredFields
Description copied from interface:TypeMethod returns ALL known fields, both explicitly declared and resolved.
- Specified by:
getDeclaredFieldsin interfaceType<T>- Returns:
- Collection of declared fields
- See Also:
-
getField
Description copied from interface:TypeReturns a declared field with the given name. If no such field was explicitly declared, an attempt will be made to resolve the respective field/getter of the declared Java class. If no such field or getter is found, the method will throw
IllegalArgumentExceptionEmpty field name has a special meaning of the
"this"value, i.e. such field's values represent the type's instances themself. -
declareField
Description copied from interface:TypeField declaration with a
Functionas value reader.- Specified by:
declareFieldin interfaceType<T>- Type Parameters:
V- field value generic type- Parameters:
name- field nametype- field value classfunction- the function that will be used to read field's value- Returns:
- a newly created field or an existing one if already declared/resolved
-
copyOf
-
equals
-
hashCode
public final int hashCode()
-