public enum MediaRestriction extends Enum<MediaRestriction> implements ConstantEnum, Writable
Enum Constant and Description |
---|
NOT
'not' keyword
|
ONLY
'only' keyword
|
Modifier and Type | Method and Description |
---|---|
boolean |
caseSensitive()
Whether the constant is case-sensitive.
|
String |
constant()
Gets the constant representing the enum member.
|
boolean |
isWritable()
Returns whether this unit should actually be written.
|
static MediaRestriction |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static MediaRestriction[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
void |
write(StyleWriter writer,
StyleAppendable appendable)
Outputs this
Writable 's string representation. |
public static final MediaRestriction ONLY
public static final MediaRestriction NOT
public static MediaRestriction[] values()
for (MediaRestriction c : MediaRestriction.values()) System.out.println(c);
public static MediaRestriction valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic String constant()
ConstantEnum
constant
in interface ConstantEnum
public boolean caseSensitive()
ConstantEnum
Important: if returning false (not case-sensitive), the value from ConstantEnum.constant()
must be lower-cased.
caseSensitive
in interface ConstantEnum
public boolean isWritable()
Writable
Usually this should just return true, however some units that are detachable or otherwise potentially invalid should first check their state and respond appropriately.
isWritable
in interface Writable
public void write(StyleWriter writer, StyleAppendable appendable) throws IOException
Writable
Writable
's string representation.
Important notes for implementation:
Do not use the StyleWriter
in an attempt to write direct content (Strings, chars, etc...). Use the StyleAppendable
.
The StyleWriter
should be used to make decisions based on writer settings (e.g., compressed vs. verbose output
mode), as well as for writing inner or child Writable
s. Do not call the this method method directly on inner
or child Writable
s! That would bypass any overrides that are set on the StyleWriter
. Use StyleWriter.writeInner(Writable, StyleAppendable)
instead.
write
in interface Writable
writer
- Writer to use for output settings and for writing inner Writable
s.appendable
- Append direct content to this StyleAppendable
.IOException
- If an I/O error occurs.Copyright (c) 2019, Salesforce.com, Inc. All rights reserved. Licensed under the BSD 3-Clause license. For full license text, see the LICENSE file in the repository.