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 int
getEntityId()
java.lang.String
getName()
Gets this entity's name.Permission
getPermission(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.Property
getProperty(java.lang.String node)
Gets a specific property by its identifier,int
hashCode()
void
removePermission(java.lang.String s)
Removes a specific permission from this entity.GrantedPermission
setPermission(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:Entity
Gets this entity's name.
-
getProperties
public java.util.Collection<Property> getProperties()
Description copied from interface:Entity
Gets a collection of this entity's properties.- Specified by:
getProperties
in interfaceEntity
- Returns:
- entity properties.
-
getProperty
public Property getProperty(java.lang.String node)
Description copied from interface:Entity
Gets a specific property by its identifier,- Specified by:
getProperty
in 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:Entity
Gets a specific pre-existing grant for this entity.- Specified by:
getPermission
in 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:Entity
Grants a specific permission to this entity.- Specified by:
setPermission
in 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:Entity
Removes a specific permission from this entity.- Specified by:
removePermission
in interfaceEntity
- Parameters:
s
- permission node to grant.
-
getPermissions
public java.util.Collection<GrantedPermission> getPermissions()
Description copied from interface:Entity
Gets the explicitly granted permissions for this entity.- Specified by:
getPermissions
in interfaceEntity
- Returns:
- permission grants.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-