Skip to content

Commit 81cedc4

Browse files
committed
Added DnsServiceRpc.
1 parent 06becd8 commit 81cedc4

1 file changed

Lines changed: 56 additions & 0 deletions

File tree

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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.spi;
18+
19+
import java.util.Map;
20+
21+
public interface DnsServiceRpc {
22+
23+
enum Option {
24+
FIELDS("fields"),
25+
PAGE_SIZE("maxSize"),
26+
PAGE_TOKEN("pageToken"),
27+
DNS_NAME("dnsName"),
28+
SORTING_KEY("sortBy"),
29+
SORTING_ORDER("sortOrder");
30+
31+
private final String value;
32+
33+
Option(String value) {
34+
this.value = value;
35+
}
36+
37+
public String value() {
38+
return value;
39+
}
40+
41+
@SuppressWarnings("unchecked")
42+
<T> T get(Map<Option, ?> options) {
43+
return (T) options.get(this);
44+
}
45+
46+
String getString(Map<Option, ?> options) {
47+
return get(options);
48+
}
49+
50+
Integer getInt(Map<Option, ?> options) {
51+
return get(options);
52+
}
53+
}
54+
55+
//TODO(mderka) add supported operations. Created issue #594.
56+
}

0 commit comments

Comments
 (0)