@PublicApi @NotThreadSafe public final class Mode extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Mode.Bits
Mode bits.
|
Constructor and Description |
---|
Mode(Mode.Bits ownerBits,
Mode.Bits groupBits,
Mode.Bits otherBits)
|
Mode(Mode mode)
Copy constructor.
|
Mode(short mode)
Constructs an instance of
Mode with the given mode. |
Modifier and Type | Method and Description |
---|---|
static Mode |
and(Mode mode1,
Mode mode2) |
static Mode |
createFullAccess()
Creates the "full access" mode.
|
static Mode |
createNoAccess()
Creates the "no access" mode.
|
static Mode |
defaults()
Gets the default mode.
|
boolean |
equals(Object obj) |
static Mode.Bits |
extractGroupBits(short mode) |
static Mode.Bits |
extractOtherBits(short mode) |
static Mode.Bits |
extractOwnerBits(short mode) |
static Mode |
fromProto(PMode pMode)
|
void |
fromShort(short n)
Sets
Mode bits using a digital representation. |
Mode.Bits |
getGroupBits() |
Mode.Bits |
getOtherBits() |
Mode.Bits |
getOwnerBits() |
int |
hashCode() |
void |
setGroupBits(Mode.Bits bits)
Sets group bits.
|
void |
setOtherBits(Mode.Bits bits)
Sets other bits.
|
void |
setOwnerBits(Mode.Bits bits)
Sets owner bits.
|
PMode |
toProto() |
short |
toShort()
Encodes the object as a short.
|
String |
toString() |
public Mode(short mode)
Mode
with the given mode.public static Mode createNoAccess()
Mode
public static Mode createFullAccess()
Mode
public static Mode and(Mode mode1, Mode mode2)
mode1
- first mode of the and operationmode2
- second mode of the and operationpublic static Mode.Bits extractOwnerBits(short mode)
public void setOwnerBits(Mode.Bits bits)
bits
- the owner bits to setpublic static Mode.Bits extractGroupBits(short mode)
public void setGroupBits(Mode.Bits bits)
bits
- the group bits to setpublic static Mode.Bits extractOtherBits(short mode)
public void setOtherBits(Mode.Bits bits)
bits
- the other bits to setpublic void fromShort(short n)
Mode
bits using a digital representation.n
- the digital representation of a Mode
public short toShort()
Mode
public static Mode fromProto(PMode pMode)
pMode
- proto modepublic PMode toProto()
Copyright © 2023. All Rights Reserved.