Module com.hedera.hashgraph.sdk
Package com.hedera.hashgraph.sdk.proto
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-
Field Summary
Fields inherited from class com.google.protobuf.GeneratedMessageLite.Builder
instance -
Method Summary
Modifier and TypeMethodDescription* A byte array of file content.* An expiration timestamp.* A list of keys that represent file "owners".* A short description of this file.Deprecated.* A realm in which this file is created.* A shard in which this file is createdcom.google.protobuf.ByteString* A byte array of file content.* An expiration timestamp.getKeys()* A list of keys that represent file "owners".getMemo()* A short description of this file.com.google.protobuf.ByteString* A short description of this file.Deprecated.* A realm in which this file is created.* A shard in which this file is createdboolean* An expiration timestamp.booleanhasKeys()* A list of keys that represent file "owners".booleanDeprecated.boolean* A realm in which this file is created.boolean* A shard in which this file is createdmergeExpirationTime(Timestamp value) * An expiration timestamp.* A list of keys that represent file "owners".mergeNewRealmAdminKey(Key value) Deprecated.mergeRealmID(RealmID value) * A realm in which this file is created.mergeShardID(ShardID value) * A shard in which this file is createdsetContents(com.google.protobuf.ByteString value) * A byte array of file content.setExpirationTime(Timestamp value) * An expiration timestamp.setExpirationTime(Timestamp.Builder builderForValue) * An expiration timestamp.* A list of keys that represent file "owners".setKeys(KeyList.Builder builderForValue) * A list of keys that represent file "owners".* A short description of this file.setMemoBytes(com.google.protobuf.ByteString value) * A short description of this file.setNewRealmAdminKey(Key value) Deprecated.setNewRealmAdminKey(Key.Builder builderForValue) Deprecated.setRealmID(RealmID value) * A realm in which this file is created.setRealmID(RealmID.Builder builderForValue) * A realm in which this file is created.setShardID(ShardID value) * A shard in which this file is createdsetShardID(ShardID.Builder builderForValue) * A shard in which this file is createdMethods inherited from class com.google.protobuf.GeneratedMessageLite.Builder
build, buildPartial, clear, clone, copyOnWrite, copyOnWriteInternal, getDefaultInstanceForType, internalMergeFrom, isInitialized, mergeFrom, mergeFrom, mergeFrom, mergeFromMethods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageExceptionMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.google.protobuf.MessageLiteOrBuilder
getDefaultInstanceForType, isInitialized
-
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:
hasExpirationTimein interfaceFileCreateTransactionBodyOrBuilder- Returns:
- Whether the expirationTime field is set.
-
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:
getExpirationTimein interfaceFileCreateTransactionBodyOrBuilder- Returns:
- The expirationTime.
-
setExpirationTime
* An expiration timestamp. <p> When the network consensus time exceeds this value, the network SHALL expire the file.
.proto.Timestamp expirationTime = 2; -
setExpirationTime
* An expiration timestamp. <p> When the network consensus time exceeds this value, the network SHALL expire the file.
.proto.Timestamp expirationTime = 2; -
mergeExpirationTime
* An expiration timestamp. <p> When the network consensus time exceeds this value, the network SHALL expire the file.
.proto.Timestamp expirationTime = 2; -
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:
hasKeysin interfaceFileCreateTransactionBodyOrBuilder- Returns:
- Whether the keys field is set.
-
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:
getKeysin interfaceFileCreateTransactionBodyOrBuilder- 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
* 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
* 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:
getContentsin interfaceFileCreateTransactionBodyOrBuilder- Returns:
- The contents.
-
setContents
* 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
* 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:
hasShardIDin interfaceFileCreateTransactionBodyOrBuilder- Returns:
- Whether the shardID field is set.
-
getShardID
* A shard in which this file is created
.proto.ShardID shardID = 5;- Specified by:
getShardIDin interfaceFileCreateTransactionBodyOrBuilder- Returns:
- The shardID.
-
setShardID
* A shard in which this file is created
.proto.ShardID shardID = 5; -
setShardID
* A shard in which this file is created
.proto.ShardID shardID = 5; -
mergeShardID
* A shard in which this file is created
.proto.ShardID shardID = 5; -
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:
hasRealmIDin interfaceFileCreateTransactionBodyOrBuilder- Returns:
- Whether the realmID field is set.
-
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:
getRealmIDin interfaceFileCreateTransactionBodyOrBuilder- Returns:
- The realmID.
-
setRealmID
* 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
* 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
* 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
* 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.* 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:
hasNewRealmAdminKeyin interfaceFileCreateTransactionBodyOrBuilder- Returns:
- Whether the newRealmAdminKey field is set.
-
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:
getNewRealmAdminKeyin interfaceFileCreateTransactionBodyOrBuilder- Returns:
- The newRealmAdminKey.
-
setNewRealmAdminKey
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.* 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.* 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
* 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:
getMemoin interfaceFileCreateTransactionBodyOrBuilder- 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:
getMemoBytesin interfaceFileCreateTransactionBodyOrBuilder- Returns:
- The bytes for memo.
-
setMemo
* 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
* 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.
-