@API(value=MAINTAINED) public class RecordTypeBuilder extends Object implements RecordTypeOrBuilder
RecordType
.
A record type consists of:
Descriptors.Descriptor
.Modifier and Type | Class and Description |
---|---|
static class |
RecordTypeBuilder.NonbuildableException
Exception thrown when a
RecordTypeBuilder is not yet in a state where it can be built. |
Constructor and Description |
---|
RecordTypeBuilder(Descriptors.Descriptor descriptor) |
RecordTypeBuilder(Descriptors.Descriptor descriptor,
RecordTypeBuilder other)
Copy constructor for
RecordTypeBuilder that copies all fields except the descriptor. |
Modifier and Type | Method and Description |
---|---|
RecordType |
build(RecordMetaData metaData) |
Descriptors.Descriptor |
getDescriptor()
Get the descriptor of the underlying message type.
|
List<Index> |
getIndexes()
Get the list of indexes that are on this record and only this record.
|
List<Index> |
getMultiTypeIndexes()
The Indexes that this record type is on that also contain other record types.
|
String |
getName()
Get the name of the record type.
|
KeyExpression |
getPrimaryKey()
Gets the primary key expression for this record type.
|
Object |
getRecordTypeKey()
Gets the
Tuple element value that will be used by RecordTypeKeyExpression for this record type. |
Integer |
getSinceVersion()
Gets a metadata version, which shows when this record type got introduced in the metadata.
|
void |
setPrimaryKey(KeyExpression primaryKey) |
RecordTypeBuilder |
setRecordTypeKey(Object recordTypeKey) |
void |
setSinceVersion(Integer sinceVersion) |
public RecordTypeBuilder(@Nonnull Descriptors.Descriptor descriptor)
public RecordTypeBuilder(@Nonnull Descriptors.Descriptor descriptor, @Nonnull RecordTypeBuilder other)
RecordTypeBuilder
that copies all fields except the descriptor.descriptor
- the descriptor of the new record typeother
- the record type builder to copy from@Nonnull public String getName()
RecordTypeOrBuilder
getName
in interface RecordTypeOrBuilder
@Nonnull public Descriptors.Descriptor getDescriptor()
RecordTypeOrBuilder
getDescriptor
in interface RecordTypeOrBuilder
@Nonnull public List<Index> getIndexes()
RecordTypeOrBuilder
getIndexes
in interface RecordTypeOrBuilder
@Nonnull public List<Index> getMultiTypeIndexes()
getMultiTypeIndexes
in interface RecordTypeOrBuilder
@Nullable public KeyExpression getPrimaryKey()
RecordTypeOrBuilder
getPrimaryKey
in interface RecordTypeOrBuilder
public void setPrimaryKey(@Nonnull KeyExpression primaryKey)
@Nullable public Integer getSinceVersion()
RecordTypeOrBuilder
getSinceVersion
in interface RecordTypeOrBuilder
null
if this information is not available)@Nullable public Object getRecordTypeKey()
RecordTypeOrBuilder
Tuple
element value that will be used by RecordTypeKeyExpression
for this record type.
The value should be unique among record types and stable in the face of meta-data changes.getRecordTypeKey
in interface RecordTypeOrBuilder
public RecordTypeBuilder setRecordTypeKey(@Nullable Object recordTypeKey)
public RecordType build(@Nonnull RecordMetaData metaData)