MutableUserStyle

public final class MutableUserStyle


A mutable UserStyle. This must be converted back to a UserStyle by calling toUserStyle.

Summary

Public fields

final int

The number of entries in the style.

Public methods

final @Nullable UserStyleSetting.Option

Returns the UserStyleSetting.Option for setting if there is one or null otherwise.

final @Nullable UserStyleSetting.Option

Returns the UserStyleSetting.Option for settingId if there is one or null otherwise.

@NonNull Iterator<@NonNull Entry.Map<@NonNull UserStyleSetting, @NonNull UserStyleSetting.Option>>

Iterator over the elements of the user style.

final void
set(
    @NonNull UserStyleSetting setting,
    @NonNull UserStyleSetting.Option option
)

Sets the UserStyleSetting.Option for setting to the given option.

final void
set(
    @NonNull UserStyleSetting.Id settingId,
    @NonNull UserStyleSetting.Option option
)

Sets the UserStyleSetting.Option for the setting with the given settingId to the given option.

final void
set(
    @NonNull UserStyleSetting setting,
    @NonNull UserStyleSetting.Option.Id optionId
)

Sets the UserStyleSetting.Option for setting to the option with the given optionId.

final void
set(
    @NonNull UserStyleSetting.Id settingId,
    @NonNull UserStyleSetting.Option.Id optionId
)

Sets the UserStyleSetting.Option for the setting with the given settingId to the option with the given optionId.

@NonNull String
final @NonNull UserStyle

Converts this instance to an immutable UserStyle with the same mapping.

Public fields

size

@NonNull
public final int size

The number of entries in the style.

Public methods

get

@Nullable
public final UserStyleSetting.Option get(@NonNull UserStyleSetting setting)

Returns the UserStyleSetting.Option for setting if there is one or null otherwise.

get

@Nullable
public final UserStyleSetting.Option get(@NonNull UserStyleSetting.Id settingId)

Returns the UserStyleSetting.Option for settingId if there is one or null otherwise. Note this is an O(n) operation.

iterator

@NonNull
public Iterator<@NonNull Entry.Map<@NonNull UserStyleSetting, @NonNull UserStyleSetting.Option>> iterator()

Iterator over the elements of the user style.

set

@NonNull
public final void set(
    @NonNull UserStyleSetting setting,
    @NonNull UserStyleSetting.Option option
)

Sets the UserStyleSetting.Option for setting to the given option.

Parameters
@NonNull UserStyleSetting setting

The UserStyleSetting we're setting the option for, must be in the schema.

@NonNull UserStyleSetting.Option option

the UserStyleSetting.Option we're setting. Must be a valid option for