Class SemanticVersion

java.lang.Object
com.hedera.hashgraph.sdk.SemanticVersion

public class SemanticVersion extends Object
Hedera follows semantic versioning () for both the HAPI protobufs and the Services software. This type allows the getVersionInfo query in the NetworkService to return the deployed versions of both protobufs and software on the node answering the query. See Hedera Documentation
  • Field Details

    • major

      public int major
      Increases with incompatible API changes
    • minor

      public int minor
      Increases with backwards-compatible new functionality
    • patch

      public int patch
      Increases with backwards-compatible bug fixes
  • Constructor Details

    • SemanticVersion

      SemanticVersion(int major, int minor, int patch)
      Constructor.
      Parameters:
      major - the major part
      minor - the minor part
      patch - the patch part
  • Method Details

    • fromProtobuf

      protected static SemanticVersion fromProtobuf(SemanticVersion version)
      Create a semantic version object from a protobuf.
      Parameters:
      version - the protobuf
      Returns:
      the new semantic version
    • fromBytes

      public static SemanticVersion fromBytes(byte[] bytes) throws com.google.protobuf.InvalidProtocolBufferException
      Create a semantic version from a byte array.
      Parameters:
      bytes - the byte array
      Returns:
      the new semantic version
      Throws:
      com.google.protobuf.InvalidProtocolBufferException - when there is an issue with the protobuf
    • toProtobuf

      protected SemanticVersion toProtobuf()
      Create the protobuf.
      Returns:
      the protobuf representation
    • toBytes

      public byte[] toBytes()
      Create the byte array.
      Returns:
      the byte array representation
    • toString

      public String toString()
      Overrides:
      toString in class Object