Class FileCreateTransactionBody.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder<FileCreateTransactionBody,FileCreateTransactionBody.Builder>
com.google.protobuf.GeneratedMessageLite.Builder<FileCreateTransactionBody,FileCreateTransactionBody.Builder>
com.hedera.hashgraph.sdk.proto.FileCreateTransactionBody.Builder
All Implemented Interfaces:
com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, FileCreateTransactionBodyOrBuilder, Cloneable
Enclosing class:
FileCreateTransactionBody

public static final class FileCreateTransactionBody.Builder extends com.google.protobuf.GeneratedMessageLite.Builder<FileCreateTransactionBody,FileCreateTransactionBody.Builder> implements FileCreateTransactionBodyOrBuilder
 *
 Create a new file.

 If successful, the new file SHALL contain the (possibly empty) content
 provided in the `contents` field.<br/>
 When the current consensus time exceeds the `expirationTime` value, the
 network SHALL expire the file, and MAY archive the state entry.

 #### Signature Requirements
 The HFS manages file authorization in a manner that can be confusing.
 The core element of file authorization is the `keys` field,
 which is a `KeyList`; a list of individual `Key` messages, each of which
 may represent a simple or complex key.<br/>
 The file service transactions treat this list differently.<br/>
 A `fileCreate`, `fileAppend`, or `fileUpdate` MUST have a valid signature
 from _each_ key in the list.<br/>
 A `fileDelete` MUST have a valid signature from _at least one_ key in
 the list. This is different, and allows a file "owned" by many entities
 to be deleted by any one of those entities. A deleted file cannot be
 restored, so it is important to consider this when assigning keys for
 a file.<br/>
 If any of the keys in a `KeyList` are complex, the full requirements of
 each complex key must be met to count as a "valid signature" for that key.
 A complex key structure (i.e. a `ThresholdKey`, or `KeyList`, possibly
 including additional `ThresholdKey` or `KeyList` descendants) may be
 assigned as the sole entry in a file `keys` field to ensure all transactions
 have the same signature requirements.

 If the `keys` field is an empty `KeyList`, then the file SHALL be immutable
 and the only transaction permitted to modify that file SHALL be a
 `fileUpdate` transaction with _only_ the `expirationTime` set.

 #### Shard and Realm
 The current API ignores shardID and realmID. All files are created in
 shard 0 and realm 0. Future versions of the API may support multiple
 realms and multiple shards.

 ### Block Stream Effects
 After the file is created, the FileID for it SHALL be returned in the
 transaction receipt, and SHALL be recorded in the transaction record.
 
Protobuf type proto.FileCreateTransactionBody
  • Method Details

    • hasExpirationTime

      public boolean hasExpirationTime()
       *
       An expiration timestamp.
       <p>
       When the network consensus time exceeds this value, the network
       SHALL expire the file.
       
      .proto.Timestamp expirationTime = 2;
      Specified by:
      hasExpirationTime in interface FileCreateTransactionBodyOrBuilder
      Returns:
      Whether the expirationTime field is set.
    • getExpirationTime

      public Timestamp getExpirationTime()
       *
       An expiration timestamp.
       <p>
       When the network consensus time exceeds this value, the network
       SHALL expire the file.
       
      .proto.Timestamp expirationTime = 2;
      Specified by:
      getExpirationTime in interface FileCreateTransactionBodyOrBuilder
      Returns:
      The expirationTime.
    • setExpirationTime

      public FileCreateTransactionBody.Builder setExpirationTime(Timestamp value)
       *
       An expiration timestamp.
       <p>
       When the network consensus time exceeds this value, the network
       SHALL expire the file.
       
      .proto.Timestamp expirationTime = 2;
    • setExpirationTime

      public FileCreateTransactionBody.Builder setExpirationTime(Timestamp.Builder builderForValue)
       *
       An expiration timestamp.
       <p>
       When the network consensus time exceeds this value, the network
       SHALL expire the file.
       
      .proto.Timestamp expirationTime = 2;
    • mergeExpirationTime

      public FileCreateTransactionBody.Builder mergeExpirationTime(Timestamp value)
       *
       An expiration timestamp.
       <p>
       When the network consensus time exceeds this value, the network
       SHALL expire the file.
       
      .proto.Timestamp expirationTime = 2;
    • clearExpirationTime

      public FileCreateTransactionBody.Builder clearExpirationTime()
       *
       An expiration timestamp.
       <p>
       When the network consensus time exceeds this value, the network
       SHALL expire the file.
       
      .proto.Timestamp expirationTime = 2;
    • hasKeys

      public boolean hasKeys()
       *
       A list of keys that represent file "owners".
       <p>
       Every `Key` in this list MUST sign this `fileCreate` transaction, as
       well as any `fileUpdate` or `fileAppend` that modifies this file.<br/>
       At least one `Key` in this list MUST sign any `fileDelete` transaction
       to delete this file.<br/>
       If this `KeyList` is empty, the file SHALL be created immutable and the
       only field that may be changed subsequently is the `expirationTime`.
       An immutable file cannot be deleted except with a `systemDelete`
       transaction, or by expiration.
       
      .proto.KeyList keys = 3;
      Specified by:
      hasKeys in interface FileCreateTransactionBodyOrBuilder
      Returns:
      Whether the keys field is set.
    • getKeys

      public KeyList getKeys()
       *
       A list of keys that represent file "owners".
       <p>
       Every `Key` in this list MUST sign this `fileCreate` transaction, as
       well as any `fileUpdate` or `fileAppend` that modifies this file.<br/>
       At least one `Key` in this list MUST sign any `fileDelete` transaction
       to delete this file.<br/>
       If this `KeyList` is empty, the file SHALL be created immutable and the
       only field that may be changed subsequently is the `expirationTime`.
       An immutable file cannot be deleted except with a `systemDelete`
       transaction, or by expiration.
       
      .proto.KeyList keys = 3;
      Specified by:
      getKeys in interface FileCreateTransactionBodyOrBuilder
      Returns:
      The keys.
    • setKeys

       *
       A list of keys that represent file "owners".
       <p>
       Every `Key` in this list MUST sign this `fileCreate` transaction, as
       well as any `fileUpdate` or `fileAppend` that modifies this file.<br/>
       At least one `Key` in this list MUST sign any `fileDelete` transaction
       to delete this file.<br/>
       If this `KeyList` is empty, the file SHALL be created immutable and the
       only field that may be changed subsequently is the `expirationTime`.
       An immutable file cannot be deleted except with a `systemDelete`
       transaction, or by expiration.
       
      .proto.KeyList keys = 3;
    • setKeys

      public FileCreateTransactionBody.Builder setKeys(KeyList.Builder builderForValue)
       *
       A list of keys that represent file "owners".
       <p>
       Every `Key` in this list MUST sign this `fileCreate` transaction, as
       well as any `fileUpdate` or `fileAppend` that modifies this file.<br/>
       At least one `Key` in this list MUST sign any `fileDelete` transaction
       to delete this file.<br/>
       If this `KeyList` is empty, the file SHALL be created immutable and the
       only field that may be changed subsequently is the `expirationTime`.
       An immutable file cannot be deleted except with a `systemDelete`
       transaction, or by expiration.
       
      .proto.KeyList keys = 3;
    • mergeKeys

      public FileCreateTransactionBody.Builder mergeKeys(KeyList value)
       *
       A list of keys that represent file "owners".
       <p>
       Every `Key` in this list MUST sign this `fileCreate` transaction, as
       well as any `fileUpdate` or `fileAppend` that modifies this file.<br/>
       At least one `Key` in this list MUST sign any `fileDelete` transaction
       to delete this file.<br/>
       If this `KeyList` is empty, the file SHALL be created immutable and the
       only field that may be changed subsequently is the `expirationTime`.
       An immutable file cannot be deleted except with a `systemDelete`
       transaction, or by expiration.
       
      .proto.KeyList keys = 3;
    • clearKeys

       *
       A list of keys that represent file "owners".
       <p>
       Every `Key` in this list MUST sign this `fileCreate` transaction, as
       well as any `fileUpdate` or `fileAppend` that modifies this file.<br/>
       At least one `Key` in this list MUST sign any `fileDelete` transaction
       to delete this file.<br/>
       If this `KeyList` is empty, the file SHALL be created immutable and the
       only field that may be changed subsequently is the `expirationTime`.
       An immutable file cannot be deleted except with a `systemDelete`
       transaction, or by expiration.
       
      .proto.KeyList keys = 3;
    • getContents

      public com.google.protobuf.ByteString getContents()
       *
       A byte array of file content.
       <p>
       The file SHALL be created with initial content equal to this field.
       
      bytes contents = 4;
      Specified by:
      getContents in interface FileCreateTransactionBodyOrBuilder
      Returns:
      The contents.
    • setContents

      public FileCreateTransactionBody.Builder setContents(com.google.protobuf.ByteString value)
       *
       A byte array of file content.
       <p>
       The file SHALL be created with initial content equal to this field.
       
      bytes contents = 4;
      Parameters:
      value - The contents to set.
      Returns:
      This builder for chaining.
    • clearContents

      public FileCreateTransactionBody.Builder clearContents()
       *
       A byte array of file content.
       <p>
       The file SHALL be created with initial content equal to this field.
       
      bytes contents = 4;
      Returns:
      This builder for chaining.
    • hasShardID

      public boolean hasShardID()
       *
       A shard in which this file is created
       
      .proto.ShardID shardID = 5;
      Specified by:
      hasShardID in interface FileCreateTransactionBodyOrBuilder
      Returns:
      Whether the shardID field is set.
    • getShardID

      public ShardID getShardID()
       *
       A shard in which this file is created
       
      .proto.ShardID shardID = 5;
      Specified by:
      getShardID in interface FileCreateTransactionBodyOrBuilder
      Returns:
      The shardID.
    • setShardID

      public FileCreateTransactionBody.Builder setShardID(ShardID value)
       *
       A shard in which this file is created
       
      .proto.ShardID shardID = 5;
    • setShardID

      public FileCreateTransactionBody.Builder setShardID(ShardID.Builder builderForValue)
       *
       A shard in which this file is created
       
      .proto.ShardID shardID = 5;
    • mergeShardID

      public FileCreateTransactionBody.Builder mergeShardID(ShardID value)
       *
       A shard in which this file is created
       
      .proto.ShardID shardID = 5;
    • clearShardID

      public FileCreateTransactionBody.Builder clearShardID()
       *
       A shard in which this file is created
       
      .proto.ShardID shardID = 5;
    • hasRealmID

      public boolean hasRealmID()
       *
       A realm in which this file is created.
       <p>
       The shard number for this realm MUST match the value in `shardID`.<br/>
       Currently, this MUST be `0` for both fields.<br/>
       If the desired realm is `0.0`, this SHOULD NOT be set.
       
      .proto.RealmID realmID = 6;
      Specified by:
      hasRealmID in interface FileCreateTransactionBodyOrBuilder
      Returns:
      Whether the realmID field is set.
    • getRealmID

      public RealmID getRealmID()
       *
       A realm in which this file is created.
       <p>
       The shard number for this realm MUST match the value in `shardID`.<br/>
       Currently, this MUST be `0` for both fields.<br/>
       If the desired realm is `0.0`, this SHOULD NOT be set.
       
      .proto.RealmID realmID = 6;
      Specified by:
      getRealmID in interface FileCreateTransactionBodyOrBuilder
      Returns:
      The realmID.
    • setRealmID

      public FileCreateTransactionBody.Builder setRealmID(RealmID value)
       *
       A realm in which this file is created.
       <p>
       The shard number for this realm MUST match the value in `shardID`.<br/>
       Currently, this MUST be `0` for both fields.<br/>
       If the desired realm is `0.0`, this SHOULD NOT be set.
       
      .proto.RealmID realmID = 6;
    • setRealmID

      public FileCreateTransactionBody.Builder setRealmID(RealmID.Builder builderForValue)
       *
       A realm in which this file is created.
       <p>
       The shard number for this realm MUST match the value in `shardID`.<br/>
       Currently, this MUST be `0` for both fields.<br/>
       If the desired realm is `0.0`, this SHOULD NOT be set.
       
      .proto.RealmID realmID = 6;
    • mergeRealmID

      public FileCreateTransactionBody.Builder mergeRealmID(RealmID value)
       *
       A realm in which this file is created.
       <p>
       The shard number for this realm MUST match the value in `shardID`.<br/>
       Currently, this MUST be `0` for both fields.<br/>
       If the desired realm is `0.0`, this SHOULD NOT be set.
       
      .proto.RealmID realmID = 6;
    • clearRealmID

      public FileCreateTransactionBody.Builder clearRealmID()
       *
       A realm in which this file is created.
       <p>
       The shard number for this realm MUST match the value in `shardID`.<br/>
       Currently, this MUST be `0` for both fields.<br/>
       If the desired realm is `0.0`, this SHOULD NOT be set.
       
      .proto.RealmID realmID = 6;
    • hasNewRealmAdminKey

      @Deprecated public boolean hasNewRealmAdminKey()
      Deprecated.
       *
       The "create realm" was never enabled, and
       should not be possible on file creation.<br/>
       An admin key for a new realm, if one is created.
       Added deprecated tag 2024-05.
       
      .proto.Key newRealmAdminKey = 7 [deprecated = true];
      Specified by:
      hasNewRealmAdminKey in interface FileCreateTransactionBodyOrBuilder
      Returns:
      Whether the newRealmAdminKey field is set.
    • getNewRealmAdminKey

      @Deprecated public Key getNewRealmAdminKey()
      Deprecated.
       *
       The "create realm" was never enabled, and
       should not be possible on file creation.<br/>
       An admin key for a new realm, if one is created.
       Added deprecated tag 2024-05.
       
      .proto.Key newRealmAdminKey = 7 [deprecated = true];
      Specified by:
      getNewRealmAdminKey in interface FileCreateTransactionBodyOrBuilder
      Returns:
      The newRealmAdminKey.
    • setNewRealmAdminKey

      @Deprecated public FileCreateTransactionBody.Builder setNewRealmAdminKey(Key value)
      Deprecated.
       *
       The "create realm" was never enabled, and
       should not be possible on file creation.<br/>
       An admin key for a new realm, if one is created.
       Added deprecated tag 2024-05.
       
      .proto.Key newRealmAdminKey = 7 [deprecated = true];
    • setNewRealmAdminKey

      @Deprecated public FileCreateTransactionBody.Builder setNewRealmAdminKey(Key.Builder builderForValue)
      Deprecated.
       *
       The "create realm" was never enabled, and
       should not be possible on file creation.<br/>
       An admin key for a new realm, if one is created.
       Added deprecated tag 2024-05.
       
      .proto.Key newRealmAdminKey = 7 [deprecated = true];
    • mergeNewRealmAdminKey

      @Deprecated public FileCreateTransactionBody.Builder mergeNewRealmAdminKey(Key value)
      Deprecated.
       *
       The "create realm" was never enabled, and
       should not be possible on file creation.<br/>
       An admin key for a new realm, if one is created.
       Added deprecated tag 2024-05.
       
      .proto.Key newRealmAdminKey = 7 [deprecated = true];
    • clearNewRealmAdminKey

      @Deprecated public FileCreateTransactionBody.Builder clearNewRealmAdminKey()
      Deprecated.
       *
       The "create realm" was never enabled, and
       should not be possible on file creation.<br/>
       An admin key for a new realm, if one is created.
       Added deprecated tag 2024-05.
       
      .proto.Key newRealmAdminKey = 7 [deprecated = true];
    • getMemo

      public String getMemo()
       *
       A short description of this file.
       <p>
       This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes`
       (default 100) bytes when encoded as UTF-8.
       
      string memo = 8;
      Specified by:
      getMemo in interface FileCreateTransactionBodyOrBuilder
      Returns:
      The memo.
    • getMemoBytes

      public com.google.protobuf.ByteString getMemoBytes()
       *
       A short description of this file.
       <p>
       This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes`
       (default 100) bytes when encoded as UTF-8.
       
      string memo = 8;
      Specified by:
      getMemoBytes in interface FileCreateTransactionBodyOrBuilder
      Returns:
      The bytes for memo.
    • setMemo

      public FileCreateTransactionBody.Builder setMemo(String value)
       *
       A short description of this file.
       <p>
       This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes`
       (default 100) bytes when encoded as UTF-8.
       
      string memo = 8;
      Parameters:
      value - The memo to set.
      Returns:
      This builder for chaining.
    • clearMemo

       *
       A short description of this file.
       <p>
       This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes`
       (default 100) bytes when encoded as UTF-8.
       
      string memo = 8;
      Returns:
      This builder for chaining.
    • setMemoBytes

      public FileCreateTransactionBody.Builder setMemoBytes(com.google.protobuf.ByteString value)
       *
       A short description of this file.
       <p>
       This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes`
       (default 100) bytes when encoded as UTF-8.
       
      string memo = 8;
      Parameters:
      value - The bytes for memo to set.
      Returns:
      This builder for chaining.