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 UserStyleSetting.Option

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

final 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

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

final void

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

final void

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

final void

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

public final int size

The number of entries in the style.

Public methods

get

public final UserStyleSetting.Option get(UserStyleSetting setting)

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

get

public final UserStyleSetting.Option get(UserStyleSetting.Id settingId)

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

iterator

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

Iterator over the elements of the user style.

set

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

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

Parameters
UserStyleSetting setting

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

UserStyleSetting.Option option

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

Throws
kotlin.IllegalArgumentException

if setting is not in the schema or if option is invalid for setting.