java.lang.Object
com.hedera.hashgraph.sdk.SemanticVersion
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SemanticVersionfromBytes(byte[] bytes) Create a semantic version from a byte array.protected static SemanticVersionfromProtobuf(SemanticVersion version) Create a semantic version object from a protobuf.byte[]toBytes()Create the byte array.protected SemanticVersionCreate the protobuf.toString()
-
Field Details
-
major
public int majorIncreases with incompatible API changes -
minor
public int minorIncreases with backwards-compatible new functionality -
patch
public int patchIncreases with backwards-compatible bug fixes
-
-
Constructor Details
-
SemanticVersion
SemanticVersion(int major, int minor, int patch) Constructor.- Parameters:
major- the major partminor- the minor partpatch- the patch part
-
-
Method Details
-
fromProtobuf
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
Create the protobuf.- Returns:
- the protobuf representation
-
toBytes
public byte[] toBytes()Create the byte array.- Returns:
- the byte array representation
-
toString
-