/** * @return the value wrapped by this {@code Optional} * @throws NullPointerException if this is empty (contains no value) */ public T get() { Preconditions.checkNotNull(value); return value; }
/** * @return the value wrapped by this {@code Optional} * @throws NullPointerException if this is empty (contains no value) */ public T get() { Preconditions.checkNotNull(value); return value; }
/** * @return the value wrapped by this {@code Optional} * @throws NullPointerException if this is empty (contains no value) */ public T get() { Preconditions.checkNotNull(value); return value; }
private Optional(T value) { Preconditions.checkNotNull(value); this.value = value; }
private Optional(T value) { Preconditions.checkNotNull(value); this.value = value; }
private Optional(T value) { Preconditions.checkNotNull(value); this.value = value; }
/** * Iterates according to the given index. */ public KVStoreView<T> index(String name) { this.index = Preconditions.checkNotNull(name); return this; }
StreamState(String appId, Iterator<ManagedBuffer> buffers) { this.appId = appId; this.buffers = Preconditions.checkNotNull(buffers); } }
public TransportClient(Channel channel, TransportResponseHandler handler) { this.channel = Preconditions.checkNotNull(channel); this.handler = Preconditions.checkNotNull(handler); this.timedOut = false; }
/** * Iterates according to the given index. */ public KVStoreView<T> index(String name) { this.index = Preconditions.checkNotNull(name); return this; }
public TransportClient(Channel channel, TransportResponseHandler handler) { this.channel = Preconditions.checkNotNull(channel); this.handler = Preconditions.checkNotNull(handler); this.timedOut = false; }
StreamState(String appId, Iterator<ManagedBuffer> buffers) { this.appId = appId; this.buffers = Preconditions.checkNotNull(buffers); } }
public TransportClient(Channel channel, TransportResponseHandler handler) { this.channel = Preconditions.checkNotNull(channel); this.handler = Preconditions.checkNotNull(handler); this.timedOut = false; }
StreamState(String appId, Iterator<ManagedBuffer> buffers) { this.appId = appId; this.buffers = Preconditions.checkNotNull(buffers); } }
private static boolean isSymlink(File file) throws IOException { Preconditions.checkNotNull(file); File fileInCanonicalDir = null; if (file.getParent() == null) { fileInCanonicalDir = file; } else { fileInCanonicalDir = new File(file.getParentFile().getCanonicalFile(), file.getName()); } return !fileInCanonicalDir.getCanonicalFile().equals(fileInCanonicalDir.getAbsoluteFile()); }
/** Encode a password as a base64-encoded char[] array. */ public static char[] encodePassword(String password) { Preconditions.checkNotNull(password, "Password cannot be null if SASL is enabled"); return getBase64EncodedString(password).toCharArray(); }
/** Encode a password as a base64-encoded char[] array. */ public static char[] encodePassword(String password) { Preconditions.checkNotNull(password, "Password cannot be null if SASL is enabled"); return getBase64EncodedString(password).toCharArray(); }
/** Encode a password as a base64-encoded char[] array. */ public static char[] encodePassword(String password) { Preconditions.checkNotNull(password, "Password cannot be null if SASL is enabled"); return getBase64EncodedString(password).toCharArray(); }
public static String encodeIdentifier(String identifier) { Preconditions.checkNotNull(identifier, "User cannot be null if SASL is enabled"); return getBase64EncodedString(identifier); }
/** The full key in the index that identifies the given entity. */ byte[] entityKey(byte[] prefix, Object entity) throws Exception { Object indexValue = getValue(entity); Preconditions.checkNotNull(indexValue, "Null index value for %s in type %s.", name, type.getName()); byte[] entityKey = start(prefix, indexValue); if (!isNatural) { entityKey = buildKey(false, entityKey, toKey(naturalIndex().getValue(entity))); } return entityKey; }