You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1001 B
36 lines
1001 B
package ru.simsonic.rscPermissions.API; |
|
|
|
import java.sql.Timestamp; |
|
|
|
public class RowEntity implements Cloneable, Comparable<RowEntity> |
|
{ |
|
public int id; |
|
public String entity; |
|
public EntityType entityType; |
|
public String prefix; |
|
public String suffix; |
|
public Timestamp lifetime; |
|
public transient String splittedId; |
|
public transient PlayerType playerType; |
|
public transient RowPermission[] permissions; |
|
public transient RowInheritance[] inheritance; |
|
@Override |
|
public RowEntity clone() throws CloneNotSupportedException |
|
{ |
|
return (RowEntity)super.clone(); |
|
} |
|
@Override |
|
public int compareTo(RowEntity other) |
|
{ |
|
if(entityType.equals(EntityType.PLAYER)) |
|
{ |
|
final int compareByPlayerType = playerType.compareTo(other.playerType); |
|
if(compareByPlayerType != 0) |
|
return 0 - compareByPlayerType; |
|
} |
|
final int compareById = Integer.compare(id, other.id); |
|
if(compareById != 0) |
|
return compareById; |
|
return entity.compareTo(other.entity); |
|
} |
|
}
|
|
|