Skip to content

Commit 3b95efe

Browse files
committed
---
yaml --- r: 3533 b: refs/heads/pubsub-alpha c: 4fdc8ee h: refs/heads/master i: 3531: df48f13
1 parent 5c653e0 commit 3b95efe

2 files changed

Lines changed: 70 additions & 1 deletion

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 36a62ef856d199f8efd09501b5ba65c422c01f23
33
refs/heads/travis: e21ee7b88a5edc3f3d8c71f90c3fc32abf7e8dd6
44
refs/heads/gh-pages: 7406918e071dd2c5677a638ae2a06e7592b6542c
5-
refs/heads/pubsub-alpha: f9b6f6a4762484da32ceee58e5281f1d615a1a12
5+
refs/heads/pubsub-alpha: 4fdc8ee53b189a137aa990dca366db369e47cf9c
66
refs/heads/update-datastore: 47aae517c2cb33f1dccd909adaced73ec9d0f4df
77
refs/tags/0.0.9: 22f1839238f66c39e67ed4dfdcd273b1ae2e8444
88
refs/tags/v0.0.10: 207ebd2a3472fddee69fe1298eb90429e3306efd
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/*
2+
* Copyright 2016 Google Inc. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.gcloud.dns;
18+
19+
import static com.google.common.base.Preconditions.checkNotNull;
20+
21+
import com.google.common.base.MoreObjects;
22+
import com.google.gcloud.spi.DnsServiceRpc;
23+
24+
import java.io.Serializable;
25+
import java.util.Objects;
26+
27+
/**
28+
* A base class for options.
29+
*/
30+
public abstract class AbstractOption implements Serializable {
31+
32+
private static final long serialVersionUID = 201601261704L;
33+
private final Object value;
34+
private final DnsServiceRpc.Option rpcOption;
35+
36+
AbstractOption(DnsServiceRpc.Option rpcOption, Object value) {
37+
this.rpcOption = checkNotNull(rpcOption);
38+
this.value = value;
39+
}
40+
41+
Object value() {
42+
return value;
43+
}
44+
45+
DnsServiceRpc.Option rpcOption() {
46+
return rpcOption;
47+
}
48+
49+
@Override
50+
public boolean equals(Object obj) {
51+
if (!(obj instanceof AbstractOption)) {
52+
return false;
53+
}
54+
AbstractOption other = (AbstractOption) obj;
55+
return Objects.equals(value, other.value);
56+
}
57+
58+
@Override
59+
public int hashCode() {
60+
return Objects.hash(value);
61+
}
62+
63+
@Override
64+
public String toString() {
65+
return MoreObjects.toStringHelper(this)
66+
.add("value", value)
67+
.toString();
68+
}
69+
}

0 commit comments

Comments
 (0)