/
HostFolderField.java
56 lines (44 loc) · 1.44 KB
/
HostFolderField.java
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
package com.dotcms.contenttype.model.field;
import java.util.Collection;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.immutables.value.Value;
import com.google.common.collect.ImmutableList;
import com.dotcms.repackage.com.google.common.base.Preconditions;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import static com.dotcms.util.CollectionsUtils.list;
@JsonSerialize(as = ImmutableHostFolderField.class)
@JsonDeserialize(as = ImmutableHostFolderField.class)
@Value.Immutable
public abstract class HostFolderField extends Field implements OnePerContentType {
@Value.Default
@Override
public boolean indexed() {
return true;
};
private static final long serialVersionUID = 1L;
@Override
public Class type() {
return HostFolderField.class;
}
@Value.Default
@Override
public DataTypes dataType(){
return DataTypes.SYSTEM;
};
@Override
public final List<DataTypes> acceptedDataTypes() {
return ImmutableList.of(DataTypes.SYSTEM, DataTypes.TEXT);
}
public abstract static class Builder implements FieldBuilder {}
@JsonIgnore
public Collection<ContentTypeFieldProperties> getFieldContentTypeProperties(){
return list(ContentTypeFieldProperties.NAME, ContentTypeFieldProperties.HINT,
ContentTypeFieldProperties.REQUIRED);
}
@JsonIgnore
public String getContentTypeFieldLabelKey(){
return "Host-Folder";
}
}