forked from gooddata/gooddata-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRestriction.java
More file actions
58 lines (48 loc) · 1.46 KB
/
Copy pathRestriction.java
File metadata and controls
58 lines (48 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package com.gooddata.md;
/**
* Metadata query restriction. See static factory methods to get instance of desired restriction type.
*/
public class Restriction {
private final Type type;
private final String value;
private Restriction(Type type, String value) {
this.type = type;
this.value = value;
}
public Type getType() {
return type;
}
public String getValue() {
return value;
}
/**
* Construct a new instance with restriction type identifier and given value.
*
* @param value identifier you want to search for
* @return new restriction for identifier restriction
*/
public static Restriction identifier(String value) {
return new Restriction(Type.IDENTIFIER, value);
}
/**
* Construct a new instance with restriction type title and given value.
*
* @param value title you want to search for
* @return new restriction for title restriction
*/
public static Restriction title(String value) {
return new Restriction(Type.TITLE, value);
}
/**
* Construct a new instance with restriction type summary and given value.
*
* @param value summary you want to search for
* @return new restriction for summary restriction
*/
public static Restriction summary(String value) {
return new Restriction(Type.SUMMARY, value);
}
static enum Type {
IDENTIFIER, TITLE, SUMMARY
}
}