@InterfaceAudience.Public @InterfaceStability.Stable public class EnumSetWritable<E extends Enum<E>> extends AbstractCollection<E> implements Writable, Configurable
Constructor and Description |
---|
EnumSetWritable(EnumSet<E> value)
Construct a new EnumSetWritable.
|
EnumSetWritable(EnumSet<E> value,
Class<E> elementType)
Construct a new EnumSetWritable.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(E e) |
boolean |
equals(Object o)
Returns true if
o is an EnumSetWritable with the same value,
or both are null. |
EnumSet<E> |
get()
Return the value of this EnumSetWritable.
|
Configuration |
getConf()
Return the configuration used by this object.
|
Class<E> |
getElementType()
Returns the class of all the elements of the underlying EnumSetWriable.
|
int |
hashCode() |
Iterator<E> |
iterator() |
void |
readFields(DataInput in)
Deserialize the fields of this object from
in . |
void |
set(EnumSet<E> value,
Class<E> elementType)
reset the EnumSetWritable with specified
value and elementType.
|
void |
setConf(Configuration conf)
Set the configuration to be used by this object.
|
int |
size() |
String |
toString() |
void |
write(DataOutput out)
Serialize the fields of this object to
out . |
addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
parallelStream, removeIf, spliterator, stream
public EnumSetWritable(EnumSet<E> value, Class<E> elementType)
value
- elementType
- public int size()
size
in interface Collection<E extends Enum<E>>
size
in class AbstractCollection<E extends Enum<E>>
public boolean add(E e)
add
in interface Collection<E extends Enum<E>>
add
in class AbstractCollection<E extends Enum<E>>
public void set(EnumSet<E> value, Class<E> elementType)
value
- elementType
- public void readFields(DataInput in) throws IOException
Writable
in
.
For efficiency, implementations should attempt to re-use storage in the existing object where possible.
readFields
in interface Writable
in
- DataInput
to deseriablize this object from.IOException
public void write(DataOutput out) throws IOException
Writable
out
.write
in interface Writable
out
- DataOuput
to serialize this object into.IOException
public boolean equals(Object o)
o
is an EnumSetWritable with the same value,
or both are null.public Class<E> getElementType()
public int hashCode()
public String toString()
toString
in class AbstractCollection<E extends Enum<E>>
public Configuration getConf()
Configurable
getConf
in interface Configurable
public void setConf(Configuration conf)
Configurable
setConf
in interface Configurable
conf
- configuration to be usedCopyright © 2020 Apache Software Foundation. All rights reserved.