Example #1
0
  /**
   * get the spec unique id
   *
   * @since JXTA 1.0
   * @return UUID module spec unique id
   */
  protected UUID getSpecUUID() {
    UUID result =
        new UUID(
            id.bytesIntoLong(ModuleSpecID.moduleSpecIdOffset),
            id.bytesIntoLong(ModuleSpecID.moduleSpecIdOffset + 8));

    return result;
  }
Example #2
0
  /**
   * Creates a ModuleSpecID in a given class, with a given class unique id. A UUID of a class and
   * another UUID are provided.
   *
   * @param classUUID the class to which this will belong.
   * @param specUUID the unique id of this spec in that class.
   */
  protected ModuleSpecID(UUID classUUID, UUID specUUID) {

    this();
    id.longIntoBytes(ModuleSpecID.moduleClassIdOffset, classUUID.getMostSignificantBits());
    id.longIntoBytes(ModuleSpecID.moduleClassIdOffset + 8, classUUID.getLeastSignificantBits());

    id.longIntoBytes(ModuleSpecID.moduleSpecIdOffset, specUUID.getMostSignificantBits());
    id.longIntoBytes(ModuleSpecID.moduleSpecIdOffset + 8, specUUID.getLeastSignificantBits());
  }
Example #3
0
  /** {@inheritDoc} */
  @Override
  public boolean equals(Object target) {
    if (this == target) {
      return true;
    }

    if (target instanceof ModuleSpecID) {
      ModuleSpecID msidTarget = (ModuleSpecID) target;

      return id.equals(msidTarget.id);
    } else {
      return false;
    }
  }
Example #4
0
 /** {@inheritDoc} */
 @Override
 public Object getUniqueValue() {
   return getIDFormat() + "-" + (String) id.getUniqueValue();
 }
Example #5
0
 /** {@inheritDoc} */
 @Override
 public int hashCode() {
   return id.hashCode();
 }