java.lang.Object
org.drasyl.node.plugin.groups.manager.data.Group

public final class Group extends Object
Class is used to model the state of a group.

This class should only plugin internally used.

  • Field Details

    • GROUP_MIN_TIMEOUT

      public static final Duration GROUP_MIN_TIMEOUT
    • GROUP_DEFAULT_TIMEOUT

      public static final Duration GROUP_DEFAULT_TIMEOUT
    • GROUP_DEFAULT_MIN_DIFFICULTY

      public static final byte GROUP_DEFAULT_MIN_DIFFICULTY
      See Also:
  • Method Details

    • getName

      public String getName()
    • getCredentials

      public String getCredentials()
    • getMinDifficulty

      public byte getMinDifficulty()
    • getTimeout

      public Duration getTimeout()
    • getTimeoutSeconds

      public long getTimeoutSeconds()
    • hashCode

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

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

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

      public GroupUri getUri(IdentityPublicKey manager)
    • of

      public static Group of(String name, String credentials, byte minDifficulty, Duration timeout)
      Creates a Group object with given parameters.
      Parameters:
      name - name of group
      credentials - credentials of group
      minDifficulty - min difficulty of group
      timeout - timeout of group
      Returns:
      created Group
      Throws:
      IllegalArgumentException - if created Group is invalid
    • of

      public static Group of(String name, String credentials)
      Creates a Group object with default minDifficulty and timeout.
      Parameters:
      name - name of group
      credentials - credentials of group
      Returns:
      created Group
      Throws:
      IllegalArgumentException - if created Group is invalid