Skip to content

Commit 62e17a9

Browse files
committed
---
yaml --- r: 4071 b: refs/heads/gcs-nio c: 4fdc8ee h: refs/heads/master i: 4069: cb313cf 4067: 54e583c 4063: a785daa
1 parent 0e33db8 commit 62e17a9

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
@@ -11,7 +11,7 @@ refs/tags/v0.0.12: 2fd8066e891fb3dfea69b65f6bf6461db79342b9
1111
refs/heads/compute-alpha: 969cba2627f1d53d352cc4a5ffe0879dacf65e6c
1212
refs/heads/dns-alpha: 2f90e7e338349287ace33375896907af0f032ca1
1313
refs/heads/dns-alpha-batch: 17442b07867021b85d0452f5f3eda29a3413288f
14-
refs/heads/gcs-nio: f9b6f6a4762484da32ceee58e5281f1d615a1a12
14+
refs/heads/gcs-nio: 4fdc8ee53b189a137aa990dca366db369e47cf9c
1515
refs/heads/logging-alpha: db5312bffa7fccac194f6a7feb8cc3066de16aff
1616
refs/tags/v0.1.0: a615317f7424ed58621b1f65d5c4d8cbbe8a6ed8
1717
refs/tags/v0.1.1: 7a7f6985fe465e9dd6a075af55493f42b4933be0
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)