Class Property.PropertyBuilder<T>
- Type Parameters:
T- The type of the value of the property.
You can create a new property using
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the property.withAdminAccessLevels(int adminAccessLevel) Sets the property access level for users.withAdminAccessLevels(PropertyAccessLevel... levels) Sets the property access level for users.withDefaultValue(@Nullable T defaultValue) Sets the default value of the property.Sets up the access levels of both users and admins to ensure neither has any kind of access to this property.withPropertyScopes(PropertyScope... propertyScopes) Sets the scopes in which this property is used.withUserAccessLevels(int userAccessLevel) Sets the property access level for users.withUserAccessLevels(PropertyAccessLevel... levels) Sets the property access level for users.
-
Method Details
-
build
-
withoutUserOrAdminAccess
Sets up the access levels of both users and admins to ensure neither has any kind of access to this property.This is the default state, so calling this method does nothing unless anything else was configured previously.
- Returns:
- This builder.
-
withUserAccessLevels
Sets the property access level for users.- Parameters:
userAccessLevel- The level of access a user had over this property as a bitflag. SeePropertyAccessLevel.- Returns:
- This builder.
-
withUserAccessLevels
Sets the property access level for users.- Parameters:
levels- The level(s) of access a user should have over this property.- Returns:
- This builder.
-
withAdminAccessLevels
Sets the property access level for users.This is a superset of the user access level by definition.
For example, if the user access level is 1 and the admin access level is 2, the resulting admin access level is 1 + 2.
- Parameters:
adminAccessLevel- The level of access an admin had over this property as a bitflag. SeePropertyAccessLevel.- Returns:
- This builder.
-
withAdminAccessLevels
Sets the property access level for users.This is a superset of the user access level by definition.
For example, if the user access level is 1 and the admin access level is 2, the resulting admin access level is 1 + 2.
- Parameters:
levels- The level(s) of access an admin should have over this property.- Returns:
- This builder.
-
withPropertyScopes
Sets the scopes in which this property is used.This determines which parts of the structure are affected by this property.
For example, the
Property.BLOCKS_TO_MOVEproperty is used in the animation scope, so changing the value of this property will clear all cached values related to the animation, such as the animation range.This defaults to no scopes.
- Parameters:
propertyScopes- The scopes in which this property is used.- Returns:
- This builder.
-
withDefaultValue
Sets the default value of the property.When the property being created is a default property for a structure type, all instances of that structure type will have this property set to the default value.
This defaults to
null.- Parameters:
defaultValue- The default value of the property.- Returns:
- This builder.
-