コード例 #1
0
  @Override
  public int compareTo(ProtectedRegion other) {
    if (getPriority() > other.getPriority()) {
      return -1;
    } else if (getPriority() < other.getPriority()) {
      return 1;
    }

    return getId().compareTo(other.getId());
  }
コード例 #2
0
 /**
  * Copy attributes from another region.
  *
  * @param other the other region
  */
 public void copyFrom(ProtectedRegion other) {
   checkNotNull(other);
   setMembers(other.getMembers());
   setOwners(other.getOwners());
   setFlags(other.getFlags());
   setPriority(other.getPriority());
   try {
     setParent(other.getParent());
   } catch (CircularInheritanceException ignore) {
     // This should not be thrown
   }
 }