Lines Matching refs:key

70      * the template's selection for that {@code key}; the difference here is
75 * @param key Which setting to alter.
81 * @throws NullPointerException If {@code key} is {@code null}.
83 public <T> boolean set(Key<T> key, T value) {
84 if (key == null) {
85 throw new NullPointerException("Received a null key");
88 Object currentValue = get(key);
90 if (!mDictionary.containsKey(key) || !Objects.equals(value, currentValue)) {
91 mDictionary.put(key, value);
105 * @param key Which setting to reset.
109 * @throws NullPointerException If {@code key} is {@code null}.
111 public boolean unset(Key<?> key) {
112 if (key == null) {
113 throw new NullPointerException("Received a null key");
116 if (mDictionary.containsKey(key)) {
117 mDictionary.remove(key);
127 * @param key Which setting to check.
131 * @throws NullPointerException If {@code key} is {@code null}.
134 public <T> T get(Key<T> key) {
135 if (key == null) {
136 throw new NullPointerException("Received a null key");
138 return (T) mDictionary.get(key);
150 * @param key Which setting to look for.
153 * @throws NullPointerException If {@code key} is {@code null}.
155 public boolean contains(Key<?> key) {
156 if (key == null) {
157 throw new NullPointerException("Received a null key");
159 return mDictionary.containsKey(key);
168 * @param key Which of this class's settings to check.
172 public <T> boolean matches(Key<T> key, T value) {
173 return Objects.equals(get(key), value);
181 * that the object's key/value pairs have changed at all, but the same
235 for (Key<?> key : mDictionary.keySet()) {
236 setRequestFieldIfNonNull(reqBuilder, key);
247 private <T> void setRequestFieldIfNonNull(Builder requestBuilder, Key<T> key) {
248 T value = get(key);
250 requestBuilder.set(key, value);