Class MaterialIcon.Builder (2.39.1)

public static final class MaterialIcon.Builder extends GeneratedMessageV3.Builder<MaterialIcon.Builder> implements MaterialIconOrBuilder

A Google Material Icon, which includes over 2500+ options.

For example, to display a checkbox icon with customized weight and grade, write the following:

<code><code> { "name": "check_box", "fill": true, "weight": 300, "grade": -25 } </code></code>

Google Chat apps:

Protobuf type google.apps.card.v1.MaterialIcon

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public MaterialIcon build()
Returns
Type Description
MaterialIcon

buildPartial()

public MaterialIcon buildPartial()
Returns
Type Description
MaterialIcon

clear()

public MaterialIcon.Builder clear()
Returns
Type Description
MaterialIcon.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

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

clearFill()

public MaterialIcon.Builder clearFill()

Whether the icon renders as filled. Default value is false.

To preview different icon settings, go to Google Font Icons and adjust the settings under Customize.

bool fill = 2;

Returns
Type Description
MaterialIcon.Builder

This builder for chaining.

clearGrade()

public MaterialIcon.Builder clearGrade()

Weight and grade affect a symbol’s thickness. Adjustments to grade are more granular than adjustments to weight and have a small impact on the size of the symbol. Choose from {-25, 0, 200}. If absent, default value is 0. If any other value is specified, the default value is used.

To preview different icon settings, go to Google Font Icons and adjust the settings under Customize.

int32 grade = 4;

Returns
Type Description
MaterialIcon.Builder

This builder for chaining.

clearName()

public MaterialIcon.Builder clearName()

The icon name defined in the Google Material Icon, for example, check_box. Any invalid names are abandoned and replaced with empty string and results in the icon failing to render.

string name = 1;

Returns
Type Description
MaterialIcon.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

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

clearWeight()

public MaterialIcon.Builder clearWeight()

The stroke weight of the icon. Choose from {100, 200, 300, 400, 500, 600, 700}. If absent, default value is 400. If any other value is specified, the default value is used.

To preview different icon settings, go to Google Font Icons and adjust the settings under Customize.

int32 weight = 3;

Returns
Type Description
MaterialIcon.Builder

This builder for chaining.

clone()

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

getDefaultInstanceForType()

public MaterialIcon getDefaultInstanceForType()
Returns
Type Description
MaterialIcon

getDescriptorForType()

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

getFill()

public boolean getFill()

Whether the icon renders as filled. Default value is false.

To preview different icon settings, go to Google Font Icons and adjust the settings under Customize.

bool fill = 2;

Returns
Type Description
boolean

The fill.

getGrade()

public int getGrade()

Weight and grade affect a symbol’s thickness. Adjustments to grade are more granular than adjustments to weight and have a small impact on the size of the symbol. Choose from {-25, 0, 200}. If absent, default value is 0. If any other value is specified, the default value is used.

To preview different icon settings, go to Google Font Icons and adjust the settings under Customize.

int32 grade = 4;

Returns
Type Description
int

The grade.

getName()

public String getName()

The icon name defined in the Google Material Icon, for example, check_box. Any invalid names are abandoned and replaced with empty string and results in the icon failing to render.

string name = 1;

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

The icon name defined in the Google Material Icon, for example, check_box. Any invalid names are abandoned and replaced with empty string and results in the icon failing to render.

string name = 1;

Returns
Type Description
ByteString

The bytes for name.

getWeight()

public int getWeight()

The stroke weight of the icon. Choose from {100, 200, 300, 400, 500, 600, 700}. If absent, default value is 400. If any other value is specified, the default value is used.

To preview different icon settings, go to Google Font Icons and adjust the settings under Customize.

int32 weight = 3;

Returns
Type Description
int

The weight.

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(MaterialIcon other)

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

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

public final MaterialIcon.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
MaterialIcon.Builder
Overrides

setField(Descriptors.FieldDescriptor field, Object value)

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

setFill(boolean value)

public MaterialIcon.Builder setFill(boolean value)

Whether the icon renders as filled. Default value is false.

To preview different icon settings, go to Google Font Icons and adjust the settings under Customize.

bool fill = 2;

Parameter
Name Description
value boolean

The fill to set.

Returns
Type Description
MaterialIcon.Builder

This builder for chaining.

setGrade(int value)

public MaterialIcon.Builder setGrade(int value)

Weight and grade affect a symbol’s thickness. Adjustments to grade are more granular than adjustments to weight and have a small impact on the size of the symbol. Choose from {-25, 0, 200}. If absent, default value is 0. If any other value is specified, the default value is used.

To preview different icon settings, go to Google Font Icons and adjust the settings under Customize.

int32 grade = 4;

Parameter
Name Description
value int

The grade to set.

Returns
Type Description
MaterialIcon.Builder

This builder for chaining.

setName(String value)

public MaterialIcon.Builder setName(String value)

The icon name defined in the Google Material Icon, for example, check_box. Any invalid names are abandoned and replaced with empty string and results in the icon failing to render.

string name = 1;

Parameter
Name Description
value String

The name to set.

Returns
Type Description
MaterialIcon.Builder

This builder for chaining.

setNameBytes(ByteString value)

public MaterialIcon.Builder setNameBytes(ByteString value)

The icon name defined in the Google Material Icon, for example, check_box. Any invalid names are abandoned and replaced with empty string and results in the icon failing to render.

string name = 1;

Parameter
Name Description
value ByteString

The bytes for name to set.

Returns
Type Description
MaterialIcon.Builder

This builder for chaining.

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

public MaterialIcon.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
MaterialIcon.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

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

setWeight(int value)

public MaterialIcon.Builder setWeight(int value)

The stroke weight of the icon. Choose from {100, 200, 300, 400, 500, 600, 700}. If absent, default value is 400. If any other value is specified, the default value is used.

To preview different icon settings, go to Google Font Icons and adjust the settings under Customize.

int32 weight = 3;

Parameter
Name Description
value int

The weight to set.

Returns
Type Description
MaterialIcon.Builder

This builder for chaining.