Class HandleValue

java.lang.Object
net.handle.hdllib.HandleValue

public class HandleValue extends Object
Represents a single handle value
  • Field Details

  • Constructor Details

    • HandleValue

      public HandleValue()
    • HandleValue

      public HandleValue(int index, byte[] type, byte[] data)
    • HandleValue

      public HandleValue(int index, String type, byte[] data)
    • HandleValue

      public HandleValue(int index, String type, String data)
    • HandleValue

      public HandleValue(int index, byte[] type, byte[] data, byte ttlType, int ttl, int timestamp, ValueReference[] references, boolean adminRead, boolean adminWrite, boolean publicRead, boolean publicWrite)
  • Method Details

    • getPermissionString

      public final String getPermissionString()
    • toDetailedString

      public String toDetailedString()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isExpired

      public boolean isExpired(int now, int timeRetrieved)
      Given the current time and the time this value was retrieved from a handle server (in seconds), return true if this value is "stale" and should be retrieved again.
    • hasType

      public final boolean hasType(byte[] someType)
      Returns whether or not this handle value has the given type. This handles subtypes, so if you call hasType("URL") and the type of this handle value is "URL.METADATA" then this will return true.
    • getDataAsString

      public final String getDataAsString()
    • getTypeAsString

      public final String getTypeAsString()
    • getTimestampAsString

      public final String getTimestampAsString()
    • getNicerTimestampAsString

      public final String getNicerTimestampAsString()
    • getTimestampAsDate

      public final Date getTimestampAsDate()
    • getIndex

      public final int getIndex()
    • setIndex

      public final void setIndex(int newIndex)
    • getType

      public final byte[] getType()
    • setType

      public final void setType(byte[] newType)
    • getData

      public final byte[] getData()
    • setData

      public final void setData(byte[] newData)
    • getTTLType

      public final byte getTTLType()
    • setTTLType

      public final void setTTLType(byte newTTLType)
    • getTTL

      public final int getTTL()
    • setTTL

      public final void setTTL(int newTTL)
    • getTimestamp

      public final int getTimestamp()
    • setTimestamp

      public final void setTimestamp(int newTimestamp)
    • getReferences

      public final ValueReference[] getReferences()
    • setReferences

      public final void setReferences(ValueReference[] newReferences)
    • getAdminCanRead

      public final boolean getAdminCanRead()
    • setAdminCanRead

      public final void setAdminCanRead(boolean newAdminRead)
    • getAdminCanWrite

      public final boolean getAdminCanWrite()
    • setAdminCanWrite

      public final void setAdminCanWrite(boolean newAdminWrite)
    • getAnyoneCanRead

      public final boolean getAnyoneCanRead()
    • setAnyoneCanRead

      public final void setAnyoneCanRead(boolean newPublicRead)
    • getAnyoneCanWrite

      public final boolean getAnyoneCanWrite()
    • setAnyoneCanWrite

      public final void setAnyoneCanWrite(boolean newPublicWrite)
    • duplicate

      public HandleValue duplicate()
      Returns a copy of this HandleValue
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • equalsIgnoreTimestamp

      public boolean equalsIgnoreTimestamp(HandleValue other)
    • unorderedEquals

      public static boolean unorderedEquals(HandleValue[] vals1, HandleValue[] vals2)
    • unorderedEqualsIgnoreTimestamp

      public static boolean unorderedEqualsIgnoreTimestamp(HandleValue[] vals1, HandleValue[] vals2)