java.lang.Comparable<ByteSizeValue>
, Writeable
, ToXContent
, ToXContentFragment
public class ByteSizeValue extends java.lang.Object implements Writeable, java.lang.Comparable<ByteSizeValue>, ToXContentFragment
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Writeable.Reader<V>, Writeable.Writer<V>
EMPTY_PARAMS
Constructor | Description |
---|---|
ByteSizeValue(long bytes) |
|
ByteSizeValue(long size,
ByteSizeUnit unit) |
|
ByteSizeValue(StreamInput in) |
Modifier and Type | Method | Description |
---|---|---|
int |
bytesAsInt() |
Deprecated.
|
int |
compareTo(ByteSizeValue other) |
|
boolean |
equals(java.lang.Object o) |
|
long |
getBytes() |
|
long |
getGb() |
|
double |
getGbFrac() |
|
long |
getKb() |
|
double |
getKbFrac() |
|
long |
getMb() |
|
double |
getMbFrac() |
|
long |
getPb() |
|
double |
getPbFrac() |
|
java.lang.String |
getStringRep() |
|
long |
getTb() |
|
double |
getTbFrac() |
|
int |
hashCode() |
|
static ByteSizeValue |
parseBytesSizeValue(java.lang.String sValue,
java.lang.String settingName) |
|
static ByteSizeValue |
parseBytesSizeValue(java.lang.String sValue,
ByteSizeValue defaultValue,
java.lang.String settingName) |
|
java.lang.String |
toString() |
|
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
|
void |
writeTo(StreamOutput out) |
Write this into the StreamOutput.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
isFragment
public ByteSizeValue(StreamInput in) throws java.io.IOException
java.io.IOException
public ByteSizeValue(long bytes)
public ByteSizeValue(long size, ByteSizeUnit unit)
public void writeTo(StreamOutput out) throws java.io.IOException
Writeable
@Deprecated public int bytesAsInt()
public long getBytes()
public long getKb()
public long getMb()
public long getGb()
public long getTb()
public long getPb()
public double getKbFrac()
public double getMbFrac()
public double getGbFrac()
public double getTbFrac()
public double getPbFrac()
public java.lang.String getStringRep()
parseBytesSizeValue(String, ByteSizeValue, String)
.
Unlike toString()
this method will not output fractional
or rounded values so this method should be preferred when
serialising the value to JSON.public java.lang.String toString()
toString
in class java.lang.Object
public static ByteSizeValue parseBytesSizeValue(java.lang.String sValue, java.lang.String settingName) throws ElasticsearchParseException
ElasticsearchParseException
public static ByteSizeValue parseBytesSizeValue(java.lang.String sValue, ByteSizeValue defaultValue, java.lang.String settingName) throws ElasticsearchParseException
ElasticsearchParseException
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public int compareTo(ByteSizeValue other)
compareTo
in interface java.lang.Comparable<ByteSizeValue>
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
toXContent
in interface ToXContent
java.io.IOException