Class Fraction.Builder (2.39.1)

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
Type Description
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Fraction.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
Fraction.Builder
Overrides

build()

public Fraction build()
Returns
Type Description
Fraction

buildPartial()

public Fraction buildPartial()
Returns
Type Description
Fraction

clear()

public Fraction.Builder clear()
Returns
Type Description
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
Type Description
Fraction.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public Fraction.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
Fraction.Builder
Overrides

clearNumerator()

public Fraction.Builder clearNumerator()

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

int64 numerator = 1;

Returns
Type Description
Fraction.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public Fraction.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
Fraction.Builder
Overrides

clone()

public Fraction.Builder clone()
Returns
Type Description
Fraction.Builder
Overrides

getDefaultInstanceForType()

public Fraction getDefaultInstanceForType()
Returns
Type Description
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
Type Description
long

The denominator.

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getNumerator()

public long getNumerator()

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

int64 numerator = 1;

Returns
Type Description
long

The numerator.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Fraction.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Fraction.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public Fraction.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
Fraction.Builder
Overrides

mergeFrom(Fraction other)

public Fraction.Builder mergeFrom(Fraction other)
Parameter
Name Description
other Fraction
Returns
Type Description
Fraction.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Fraction.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
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
Name Description
value long

The denominator to set.

Returns
Type Description
Fraction.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public Fraction.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
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
Name Description
value long

The numerator to set.

Returns
Type Description
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
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
Fraction.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final Fraction.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Fraction.Builder
Overrides