Package io.manebot.database.model
Class Entity
- java.lang.Object
-
- io.manebot.database.model.TimedRow
-
- io.manebot.database.model.Entity
-
-
Constructor Summary
Constructors Constructor Description Entity(Database database)Entity(Database database, EntityType type)
-
Method Summary
Modifier and Type Method Description intgetEntityId()java.lang.StringgetName()Gets this entity's name.PermissiongetPermission(java.lang.String node)Gets a specific pre-existing grant for this entity.java.util.Collection<GrantedPermission>getPermissions()Gets the explicitly granted permissions for this entity.java.util.Collection<Property>getProperties()Gets a collection of this entity's properties.PropertygetProperty(java.lang.String node)Gets a specific property by its identifier,inthashCode()voidremovePermission(java.lang.String s)Removes a specific permission from this entity.GrantedPermissionsetPermission(java.lang.String node, Grant grant)Grants a specific permission to this entity.-
Methods inherited from class io.manebot.database.model.TimedRow
getCreated, getCreatedDate, getUpdated, getUpdatedDate, setCreated, setCreated, setCreatedDate, setUpdated, setUpdated, setUpdatedDate
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.manebot.entity.Entity
getPermission
-
-
-
-
Constructor Detail
-
Entity
public Entity(Database database)
-
Entity
public Entity(Database database, EntityType type)
-
-
Method Detail
-
getEntityId
public int getEntityId()
-
getName
public java.lang.String getName()
Description copied from interface:EntityGets this entity's name.
-
getProperties
public java.util.Collection<Property> getProperties()
Description copied from interface:EntityGets a collection of this entity's properties.- Specified by:
getPropertiesin interfaceEntity- Returns:
- entity properties.
-
getProperty
public Property getProperty(java.lang.String node)
Description copied from interface:EntityGets a specific property by its identifier,- Specified by:
getPropertyin interfaceEntity- Parameters:
node- entity property identifier.- Returns:
- Property instance if a property exists by that ID, and a null-valued Property otherwise.
-
getPermission
public Permission getPermission(java.lang.String node)
Description copied from interface:EntityGets a specific pre-existing grant for this entity.- Specified by:
getPermissionin interfaceEntity- Parameters:
node- permission node to check for.- Returns:
- ALLOW or DENY, null if no permission grant is explicitly defined.
-
setPermission
public GrantedPermission setPermission(java.lang.String node, Grant grant) throws java.lang.SecurityException
Description copied from interface:EntityGrants a specific permission to this entity.- Specified by:
setPermissionin interfaceEntity- Parameters:
node- permission node to grant.grant- type of grant to supply.- Throws:
java.lang.SecurityException
-
removePermission
public void removePermission(java.lang.String s)
Description copied from interface:EntityRemoves a specific permission from this entity.- Specified by:
removePermissionin interfaceEntity- Parameters:
s- permission node to grant.
-
getPermissions
public java.util.Collection<GrantedPermission> getPermissions()
Description copied from interface:EntityGets the explicitly granted permissions for this entity.- Specified by:
getPermissionsin interfaceEntity- Returns:
- permission grants.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-