Package com.github.ambry.store
Class MessageInfo.Builder
- java.lang.Object
-
- com.github.ambry.store.MessageInfo.Builder
-
- Enclosing class:
- MessageInfo
public static class MessageInfo.Builder extends java.lang.Object
A builder class forMessageInfo
.
-
-
Constructor Summary
Constructors Constructor Description Builder(MessageInfo info)
Constructor to create a builder fromMessageInfo
.Builder(StoreKey key, long size, short accountId, short containerId, long operationTimeMs)
Constructor to create a builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MessageInfo.Builder
accountId(short accountId)
Sets the accountId of theMessageInfo
to build.MessageInfo
build()
Builds aMessageInfo
object.MessageInfo.Builder
containerId(short containerId)
Sets the containerId of theMessageInfo
to build.MessageInfo.Builder
crc(java.lang.Long crc)
Sets crc of theMessageInfo
to build.MessageInfo.Builder
expirationTimeInMs(long expirationTimeInMs)
Sets expirationTime in ms of theMessageInfo
to build.MessageInfo.Builder
isDeleted(boolean isDeleted)
Sets isDeleted flag of theMessageInfo
to build.MessageInfo.Builder
isTtlUpdated(boolean isTtlUpdated)
Sets isTtlUpdated flag of theMessageInfo
to build.MessageInfo.Builder
isUndeleted(boolean isUndeleted)
Sets isUndeleted flag of theMessageInfo
to build.MessageInfo.Builder
lifeVersion(short lifeVersion)
Sets the lifeVersion of theMessageInfo
to build.MessageInfo.Builder
operationTimeMs(long operationTimeMs)
Sets the operationTime in ms of theMessageInfo
to build.MessageInfo.Builder
size(long size)
Sets the size of theMessageInfo
to build.MessageInfo.Builder
storeKey(StoreKey key)
Sets the key of theMessageInfo
to build.
-
-
-
Constructor Detail
-
Builder
public Builder(StoreKey key, long size, short accountId, short containerId, long operationTimeMs)
Constructor to create a builder.- Parameters:
key
- TheStoreKey
associated withMessageInfo
.size
- The size of this message in bytes.accountId
- accountId of the blob.containerId
- containerId of the blob.operationTimeMs
- operation time in ms.
-
Builder
public Builder(MessageInfo info)
Constructor to create a builder fromMessageInfo
.- Parameters:
info
- TheMessageInfo
to build from.
-
-
Method Detail
-
build
public MessageInfo build()
Builds aMessageInfo
object.- Returns:
- A
MessageInfo
object.
-
storeKey
public MessageInfo.Builder storeKey(StoreKey key)
Sets the key of theMessageInfo
to build.- Parameters:
key
- the key to set.- Returns:
- This builder.
-
accountId
public MessageInfo.Builder accountId(short accountId)
Sets the accountId of theMessageInfo
to build.- Parameters:
accountId
- the accountId to set.- Returns:
- This builder.
-
containerId
public MessageInfo.Builder containerId(short containerId)
Sets the containerId of theMessageInfo
to build.- Parameters:
containerId
- the containerId to set.- Returns:
- This builder.
-
operationTimeMs
public MessageInfo.Builder operationTimeMs(long operationTimeMs)
Sets the operationTime in ms of theMessageInfo
to build.- Parameters:
operationTimeMs
- the operationTime to set.- Returns:
- This builder.
-
size
public MessageInfo.Builder size(long size)
Sets the size of theMessageInfo
to build.- Parameters:
size
- the size to set.- Returns:
- This builder.
-
expirationTimeInMs
public MessageInfo.Builder expirationTimeInMs(long expirationTimeInMs)
Sets expirationTime in ms of theMessageInfo
to build.- Parameters:
expirationTimeInMs
- the expirationTime to set- Returns:
- This builder.
-
isDeleted
public MessageInfo.Builder isDeleted(boolean isDeleted)
Sets isDeleted flag of theMessageInfo
to build.- Parameters:
isDeleted
- the isDeleted to set.- Returns:
- This builder.
-
isTtlUpdated
public MessageInfo.Builder isTtlUpdated(boolean isTtlUpdated)
Sets isTtlUpdated flag of theMessageInfo
to build.- Parameters:
isTtlUpdated
- the isTtlUpdated to set.- Returns:
- This builder.
-
isUndeleted
public MessageInfo.Builder isUndeleted(boolean isUndeleted)
Sets isUndeleted flag of theMessageInfo
to build.- Parameters:
isUndeleted
- the isUndeleted to set.- Returns:
- This builder.
-
crc
public MessageInfo.Builder crc(java.lang.Long crc)
Sets crc of theMessageInfo
to build.- Parameters:
crc
- the crc to set.- Returns:
- This builder.
-
lifeVersion
public MessageInfo.Builder lifeVersion(short lifeVersion)
Sets the lifeVersion of theMessageInfo
to build.- Parameters:
lifeVersion
- the lifeVersion to set.- Returns:
- This builder.
-
-