Package com.syzygy.events.database
Class DatabaseInstance.PropertyField<V,W extends DatabaseInstance<W>>
java.lang.Object
com.syzygy.events.database.DatabaseInstance.PropertyField<V,W>
- Type Parameters:
V
- The type of the value that the property storesW
- The type of the instance that the property stores if applicable
- Enclosing class:
- DatabaseInstance<T extends DatabaseInstance<T>>
Designates a property that is maintained by a Database instance
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
This class exists to fulfill the wildcard for PropertyWrappers -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal boolean
If the property can be editedfinal boolean
The function to test if a given value is valid for this propertyfinal boolean
If the property loads an instancefinal Database.Collections
The collection that the instance is apart of if applicablefinal boolean
If the instance can be nullfinal int
The ID of the res string that defines the string used for the property key in the database -
Constructor Summary
ConstructorsConstructorDescriptionPropertyField
(int propertyNameID, Predicate<Object> isValid, boolean canEdit) Setsloads
tofalse
PropertyField
(int propertyNameID, Predicate<Object> isValid, boolean canEdit, boolean loads, Database.Collections loadsCollection, boolean nullable, boolean cascadeDelete) -
Method Summary
Modifier and TypeMethodDescription(package private) DatabaseInstance.PropertyWrapper<?,
?> Gets the associated wrapper object
-
Field Details
-
propertyNameID
public final int propertyNameIDThe ID of the res string that defines the string used for the property key in the database -
isValid
The function to test if a given value is valid for this property -
canEdit
public final boolean canEditIf the property can be edited -
loads
public final boolean loadsIf the property loads an instance -
loadsCollection
The collection that the instance is apart of if applicable -
loadsNullable
public final boolean loadsNullableIf the instance can be null -
cascadeDelete
public final boolean cascadeDelete
-
-
Constructor Details
-
PropertyField
public PropertyField(int propertyNameID, Predicate<Object> isValid, boolean canEdit, boolean loads, Database.Collections loadsCollection, boolean nullable, boolean cascadeDelete) - Parameters:
propertyNameID
- The ID of the res string that defines the string used for the property key in the databaseisValid
- The function to test if a given value is valid for this propertycanEdit
- If the property can be editedloads
- If the property loads an instanceloadsCollection
- The collection that the instance is apart of if applicablenullable
- If the instance can be nullcascadeDelete
- If the instance should be deleted upon the deletion of this instance
-
PropertyField
Sets
loads
tofalse
- Parameters:
propertyNameID
- The ID of the res string that defines the string used for the property key in the databaseisValid
- The function to test if a given value is valid for this propertycanEdit
- If the property can be edited
-
-
Method Details
-
getWrapper
DatabaseInstance.PropertyWrapper<?,?> getWrapper()Gets the associated wrapper object- Returns:
- If the property is a instance
DatabaseInstance.InstancePropertyWrapper
; if the property is a valueDatabaseInstance.PropertyWrapper
-