public class TextBooleanReference extends AbstractReference implements net.openhft.chronicle.core.values.BooleanValue
The boolean values ' true' and 'false' are represented internally as
32-bit integers in a specific format. The class also provides methods for
writing the boolean values into BytesStore
objects.
bytes, offset
Constructor and Description |
---|
TextBooleanReference() |
Modifier and Type | Method and Description |
---|---|
boolean |
getValue()
Get the current value of this reference.
|
long |
maxSize()
Returns the maximum size of the text representation of the boolean value in bytes.
|
void |
setValue(boolean value)
Set the value of this reference.
|
@NotNull String |
toString()
Returns a string representation of this TextBooleanReference object,
displaying the value it represents.
|
static void |
write(boolean value,
BytesStore bytes,
long offset)
Writes a boolean value to the specified
BytesStore at the given offset
in text wire format. |
acceptNewBytesStore, address, bytesStore, bytesStore, lock, offset, performClose, tryLock
assertCloseable, assertCloseablesClosed, clearUsedByThread, close, createdHere, disableCloseableTracing, disableThreadSafetyCheck, disableThreadSafetyCheck, enableCloseableTracing, gcAndWaitForCloseablesToClose, isClosed, isClosing, isInUserThread, referenceId, resetUsedByThread, shouldPerformCloseInBackground, shouldWaitForClosed, singleThreadedCheckDisabled, singleThreadedCheckDisabled, singleThreadedCheckReset, threadSafetyCheck, throwExceptionIfClosed, throwExceptionIfClosedInSetter, unmonitor, waitForCloseablesToClose, waitForClosed, warnAndCloseIfNotClosed
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public static void write(boolean value, BytesStore bytes, long offset) throws IllegalStateException, BufferOverflowException
BytesStore
at the given offset
in text wire format.value
- the boolean value to write.bytes
- the BytesStore to write to.offset
- the offset at which to write the value.IllegalStateException
- if an invalid state is encountered.BufferOverflowException
- if there's not enough space in the buffer to write the value.public long maxSize()
@NotNull public @NotNull String toString()
toString
in class net.openhft.chronicle.core.io.AbstractCloseable
public boolean getValue() throws IllegalStateException, BufferUnderflowException
getValue
in interface net.openhft.chronicle.core.values.BooleanValue
IllegalStateException
- if the underlying bytes store is closed.BufferUnderflowException
- if the underlying bytes store cannot provide enough data.public void setValue(boolean value) throws IllegalStateException
setValue
in interface net.openhft.chronicle.core.values.BooleanValue
value
- the new value.IllegalStateException
- if the underlying bytes store is closed.Copyright © 2023. All rights reserved.