Class Fraction.Builder (2.28.0)

public static final class Fraction.Builder extends GeneratedMessageV3.Builder<Fraction.Builder> implements FractionOrBuilder

Represents a fraction in terms of a numerator divided by a denominator.

Protobuf type google.type.Fraction

Implements

FractionOrBuilder

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Fraction.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Fraction.Builder
Overrides

build()

public Fraction build()
Returns
TypeDescription
Fraction

buildPartial()

public Fraction buildPartial()
Returns
TypeDescription
Fraction

clear()

public Fraction.Builder clear()
Returns
TypeDescription
Fraction.Builder
Overrides

clearDenominator()

public Fraction.Builder clearDenominator()

The value by which the numerator is divided, e.g. 3 in 2/3. Must be positive.

int64 denominator = 2;

Returns
TypeDescription
Fraction.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public Fraction.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
Fraction.Builder
Overrides

clearNumerator()

public Fraction.Builder clearNumerator()

The numerator in the fraction, e.g. 2 in 2/3.

int64 numerator = 1;

Returns
TypeDescription
Fraction.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public Fraction.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
Fraction.Builder
Overrides

clone()

public Fraction.Builder clone()
Returns
TypeDescription
Fraction.Builder
Overrides

getDefaultInstanceForType()

public Fraction getDefaultInstanceForType()
Returns
TypeDescription
Fraction

getDenominator()

public long getDenominator()

The value by which the numerator is divided, e.g. 3 in 2/3. Must be positive.

int64 denominator = 2;

Returns
TypeDescription
long

The denominator.

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getNumerator()

public long getNumerator()

The numerator in the fraction, e.g. 2 in 2/3.

int64 numerator = 1;

Returns
TypeDescription
long

The numerator.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Fraction.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Fraction.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public Fraction.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
Fraction.Builder
Overrides

mergeFrom(Fraction other)

public Fraction.Builder mergeFrom(Fraction other)
Parameter
NameDescription
otherFraction
Returns
TypeDescription
Fraction.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Fraction.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
Fraction.Builder
Overrides

setDenominator(long value)

public Fraction.Builder setDenominator(long value)

The value by which the numerator is divided, e.g. 3 in 2/3. Must be positive.

int64 denominator = 2;

Parameter
NameDescription
valuelong

The denominator to set.

Returns
TypeDescription
Fraction.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public Fraction.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Fraction.Builder
Overrides

setNumerator(long value)

public Fraction.Builder setNumerator(long value)

The numerator in the fraction, e.g. 2 in 2/3.

int64 numerator = 1;

Parameter
NameDescription
valuelong

The numerator to set.

Returns
TypeDescription
Fraction.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public Fraction.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
Fraction.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final Fraction.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
Fraction.Builder
Overrides