Class File.Builder

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

public static final class File.Builder extends com.google.protobuf.GeneratedMessageLite.Builder<File,File.Builder> implements FileOrBuilder
 *
 Representation of an Hedera File Service `file`.

 Files offer a place to store additional data, much more than is available in
 other entities, for use with smart contracts, non-fungible tokens, etc...
 As with all network entities, a file has a unique entity number, which is
 given along with the network's shard and realm in the form of a
 shard.realm.number id.
 
Protobuf type proto.File
  • Field Summary

    Fields inherited from class com.google.protobuf.GeneratedMessageLite.Builder

    instance
  • Method Summary

    Modifier and Type
    Method
    Description
    * The contents of the file.
    * A flag indicating that this file is deleted.
    * The file's expiration time in seconds since the epoch.<br/> This value should be compared against consensus time, which may not exactly match clock time at the moment of expiration.
    * This file's ID within the global network state.
    * A list of keys that MUST sign any transaction to create or update this file.
    * A short description of the file.
    * The pre-system-delete expiration time of a deleted "system" file, in seconds.
    com.google.protobuf.ByteString
    * The contents of the file.
    boolean
    * A flag indicating that this file is deleted.
    long
    * The file's expiration time in seconds since the epoch.<br/> This value should be compared against consensus time, which may not exactly match clock time at the moment of expiration.
    * This file's ID within the global network state.
    * A list of keys that MUST sign any transaction to create or update this file.
    * A short description of the file.
    com.google.protobuf.ByteString
    * A short description of the file.
    long
    * The pre-system-delete expiration time of a deleted "system" file, in seconds.
    boolean
    * This file's ID within the global network state.
    boolean
    * A list of keys that MUST sign any transaction to create or update this file.
    * This file's ID within the global network state.
    * A list of keys that MUST sign any transaction to create or update this file.
    setContents(com.google.protobuf.ByteString value)
    * The contents of the file.
    setDeleted(boolean value)
    * A flag indicating that this file is deleted.
    setExpirationSecond(long value)
    * The file's expiration time in seconds since the epoch.<br/> This value should be compared against consensus time, which may not exactly match clock time at the moment of expiration.
    * This file's ID within the global network state.
    setFileId(FileID.Builder builderForValue)
    * This file's ID within the global network state.
    * A list of keys that MUST sign any transaction to create or update this file.
    setKeys(KeyList.Builder builderForValue)
    * A list of keys that MUST sign any transaction to create or update this file.
    setMemo(String value)
    * A short description of the file.
    setMemoBytes(com.google.protobuf.ByteString value)
    * A short description of the file.
    * The pre-system-delete expiration time of a deleted "system" file, in seconds.

    Methods inherited from class com.google.protobuf.GeneratedMessageLite.Builder

    build, buildPartial, clear, clone, copyOnWrite, copyOnWriteInternal, getDefaultInstanceForType, internalMergeFrom, isInitialized, mergeFrom, mergeFrom, mergeFrom, mergeFrom

    Methods inherited from class com.google.protobuf.AbstractMessageLite.Builder

    addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.google.protobuf.MessageLiteOrBuilder

    getDefaultInstanceForType, isInitialized
  • Method Details

    • hasFileId

      public boolean hasFileId()
       *
       This file's ID within the global network state.
       <p>
       This value SHALL be unique within the network.
       
      .proto.FileID file_id = 1;
      Specified by:
      hasFileId in interface FileOrBuilder
      Returns:
      Whether the fileId field is set.
    • getFileId

      public FileID getFileId()
       *
       This file's ID within the global network state.
       <p>
       This value SHALL be unique within the network.
       
      .proto.FileID file_id = 1;
      Specified by:
      getFileId in interface FileOrBuilder
      Returns:
      The fileId.
    • setFileId

      public File.Builder setFileId(FileID value)
       *
       This file's ID within the global network state.
       <p>
       This value SHALL be unique within the network.
       
      .proto.FileID file_id = 1;
    • setFileId

      public File.Builder setFileId(FileID.Builder builderForValue)
       *
       This file's ID within the global network state.
       <p>
       This value SHALL be unique within the network.
       
      .proto.FileID file_id = 1;
    • mergeFileId

      public File.Builder mergeFileId(FileID value)
       *
       This file's ID within the global network state.
       <p>
       This value SHALL be unique within the network.
       
      .proto.FileID file_id = 1;
    • clearFileId

      public File.Builder clearFileId()
       *
       This file's ID within the global network state.
       <p>
       This value SHALL be unique within the network.
       
      .proto.FileID file_id = 1;
    • getExpirationSecond

      public long getExpirationSecond()
       *
       The file's expiration time in seconds since the epoch.<br/>
       This value should be compared against consensus time, which may not
       exactly match clock time at the moment of expiration.
       <p>
       For this purpose, `epoch` SHALL be the UNIX epoch with 0 at `1970-01-01T00:00:00.000Z`.
       
      int64 expiration_second = 2;
      Specified by:
      getExpirationSecond in interface FileOrBuilder
      Returns:
      The expirationSecond.
    • setExpirationSecond

      public File.Builder setExpirationSecond(long value)
       *
       The file's expiration time in seconds since the epoch.<br/>
       This value should be compared against consensus time, which may not
       exactly match clock time at the moment of expiration.
       <p>
       For this purpose, `epoch` SHALL be the UNIX epoch with 0 at `1970-01-01T00:00:00.000Z`.
       
      int64 expiration_second = 2;
      Parameters:
      value - The expirationSecond to set.
      Returns:
      This builder for chaining.
    • clearExpirationSecond

      public File.Builder clearExpirationSecond()
       *
       The file's expiration time in seconds since the epoch.<br/>
       This value should be compared against consensus time, which may not
       exactly match clock time at the moment of expiration.
       <p>
       For this purpose, `epoch` SHALL be the UNIX epoch with 0 at `1970-01-01T00:00:00.000Z`.
       
      int64 expiration_second = 2;
      Returns:
      This builder for chaining.
    • hasKeys

      public boolean hasKeys()
       *
       A list of keys that MUST sign any transaction to create
       or update this file.
       <p>
       Only _one_ of these keys must sign a transaction to delete the file.<br/>
       This field MAY be `null` or an empty list.<br/>
       If this field is null or an empty `KeyList`, then the file SHALL be
       immutable.<br/>
       For an immutable file, the only transaction permitted to modify that
       file SHALL be a `fileUpdate` transaction with _only_ the
       `expirationTime` set.
       
      .proto.KeyList keys = 3;
      Specified by:
      hasKeys in interface FileOrBuilder
      Returns:
      Whether the keys field is set.
    • getKeys

      public KeyList getKeys()
       *
       A list of keys that MUST sign any transaction to create
       or update this file.
       <p>
       Only _one_ of these keys must sign a transaction to delete the file.<br/>
       This field MAY be `null` or an empty list.<br/>
       If this field is null or an empty `KeyList`, then the file SHALL be
       immutable.<br/>
       For an immutable file, the only transaction permitted to modify that
       file SHALL be a `fileUpdate` transaction with _only_ the
       `expirationTime` set.
       
      .proto.KeyList keys = 3;
      Specified by:
      getKeys in interface FileOrBuilder
      Returns:
      The keys.
    • setKeys

      public File.Builder setKeys(KeyList value)
       *
       A list of keys that MUST sign any transaction to create
       or update this file.
       <p>
       Only _one_ of these keys must sign a transaction to delete the file.<br/>
       This field MAY be `null` or an empty list.<br/>
       If this field is null or an empty `KeyList`, then the file SHALL be
       immutable.<br/>
       For an immutable file, the only transaction permitted to modify that
       file SHALL be a `fileUpdate` transaction with _only_ the
       `expirationTime` set.
       
      .proto.KeyList keys = 3;
    • setKeys

      public File.Builder setKeys(KeyList.Builder builderForValue)
       *
       A list of keys that MUST sign any transaction to create
       or update this file.
       <p>
       Only _one_ of these keys must sign a transaction to delete the file.<br/>
       This field MAY be `null` or an empty list.<br/>
       If this field is null or an empty `KeyList`, then the file SHALL be
       immutable.<br/>
       For an immutable file, the only transaction permitted to modify that
       file SHALL be a `fileUpdate` transaction with _only_ the
       `expirationTime` set.
       
      .proto.KeyList keys = 3;
    • mergeKeys

      public File.Builder mergeKeys(KeyList value)
       *
       A list of keys that MUST sign any transaction to create
       or update this file.
       <p>
       Only _one_ of these keys must sign a transaction to delete the file.<br/>
       This field MAY be `null` or an empty list.<br/>
       If this field is null or an empty `KeyList`, then the file SHALL be
       immutable.<br/>
       For an immutable file, the only transaction permitted to modify that
       file SHALL be a `fileUpdate` transaction with _only_ the
       `expirationTime` set.
       
      .proto.KeyList keys = 3;
    • clearKeys

      public File.Builder clearKeys()
       *
       A list of keys that MUST sign any transaction to create
       or update this file.
       <p>
       Only _one_ of these keys must sign a transaction to delete the file.<br/>
       This field MAY be `null` or an empty list.<br/>
       If this field is null or an empty `KeyList`, then the file SHALL be
       immutable.<br/>
       For an immutable file, the only transaction permitted to modify that
       file SHALL be a `fileUpdate` transaction with _only_ the
       `expirationTime` set.
       
      .proto.KeyList keys = 3;
    • getContents

      public com.google.protobuf.ByteString getContents()
       *
       The contents of the file.
       <p>
       This SHALL be limited to the current maximum file size; typically no
       more than 1 Megabyte (1048576 bytes).
       
      bytes contents = 4;
      Specified by:
      getContents in interface FileOrBuilder
      Returns:
      The contents.
    • setContents

      public File.Builder setContents(com.google.protobuf.ByteString value)
       *
       The contents of the file.
       <p>
       This SHALL be limited to the current maximum file size; typically no
       more than 1 Megabyte (1048576 bytes).
       
      bytes contents = 4;
      Parameters:
      value - The contents to set.
      Returns:
      This builder for chaining.
    • clearContents

      public File.Builder clearContents()
       *
       The contents of the file.
       <p>
       This SHALL be limited to the current maximum file size; typically no
       more than 1 Megabyte (1048576 bytes).
       
      bytes contents = 4;
      Returns:
      This builder for chaining.
    • getMemo

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

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

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

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

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

      public boolean getDeleted()
       *
       A flag indicating that this file is deleted.
       <p>
       The `contents` of a deleted "regular" file SHALL be an empty
       (zero length) bytes.
       
      bool deleted = 6;
      Specified by:
      getDeleted in interface FileOrBuilder
      Returns:
      The deleted.
    • setDeleted

      public File.Builder setDeleted(boolean value)
       *
       A flag indicating that this file is deleted.
       <p>
       The `contents` of a deleted "regular" file SHALL be an empty
       (zero length) bytes.
       
      bool deleted = 6;
      Parameters:
      value - The deleted to set.
      Returns:
      This builder for chaining.
    • clearDeleted

      public File.Builder clearDeleted()
       *
       A flag indicating that this file is deleted.
       <p>
       The `contents` of a deleted "regular" file SHALL be an empty
       (zero length) bytes.
       
      bool deleted = 6;
      Returns:
      This builder for chaining.
    • getPreSystemDeleteExpirationSecond

      public long getPreSystemDeleteExpirationSecond()
       *
       The pre-system-delete expiration time of a deleted "system" file, in seconds.
       <p>
       This field SHALL contain the original expiration time of a "system" file
       that is deleted. This SHOULD be used to restore that expiration time if
       the file is subsequently "un-deleted" before it is purged from the
       system.<br/>
       A "regular" file cannot be "un-deleted", so this field SHALL NOT be set
       for those files.
       
      int64 pre_system_delete_expiration_second = 7;
      Specified by:
      getPreSystemDeleteExpirationSecond in interface FileOrBuilder
      Returns:
      The preSystemDeleteExpirationSecond.
    • setPreSystemDeleteExpirationSecond

      public File.Builder setPreSystemDeleteExpirationSecond(long value)
       *
       The pre-system-delete expiration time of a deleted "system" file, in seconds.
       <p>
       This field SHALL contain the original expiration time of a "system" file
       that is deleted. This SHOULD be used to restore that expiration time if
       the file is subsequently "un-deleted" before it is purged from the
       system.<br/>
       A "regular" file cannot be "un-deleted", so this field SHALL NOT be set
       for those files.
       
      int64 pre_system_delete_expiration_second = 7;
      Parameters:
      value - The preSystemDeleteExpirationSecond to set.
      Returns:
      This builder for chaining.
    • clearPreSystemDeleteExpirationSecond

      public File.Builder clearPreSystemDeleteExpirationSecond()
       *
       The pre-system-delete expiration time of a deleted "system" file, in seconds.
       <p>
       This field SHALL contain the original expiration time of a "system" file
       that is deleted. This SHOULD be used to restore that expiration time if
       the file is subsequently "un-deleted" before it is purged from the
       system.<br/>
       A "regular" file cannot be "un-deleted", so this field SHALL NOT be set
       for those files.
       
      int64 pre_system_delete_expiration_second = 7;
      Returns:
      This builder for chaining.