本文整理汇总了Java中com.contentful.vault.Resource类的典型用法代码示例。如果您正苦于以下问题:Java Resource类的具体用法?Java Resource怎么用?Java Resource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Resource类属于com.contentful.vault包,在下文中一共展示了Resource类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: appendTypes
import com.contentful.vault.Resource; //导入依赖的package包/类
private void appendTypes(TypeSpec.Builder builder) {
// Field
TypeName classTypeName = ParameterizedTypeName.get(ClassName.get(Class.class),
WildcardTypeName.subtypeOf(Resource.class));
specTypes =
createMapWithInitializer("types", LinkedHashMap.class, ClassName.get(String.class),
classTypeName)
.addModifiers(Modifier.FINAL)
.build();
builder.addField(specTypes);
// Getter
builder.addMethod(createGetterImpl(specTypes, "getTypes").build());
}
示例2: getLinkType
import com.contentful.vault.Resource; //导入依赖的package包/类
private String getLinkType(TypeMirror typeMirror) {
if (isSubtypeOfType(typeMirror, Resource.class.getName())) {
if (isSubtypeOfType(typeMirror, FQ_ASSET)) {
return ASSET.toString();
} else {
return ENTRY.toString();
}
}
return null;
}
示例3: isValidListType
import com.contentful.vault.Resource; //导入依赖的package包/类
private boolean isValidListType(TypeMirror typeMirror) {
return isSubtypeOfType(typeMirror, String.class.getName()) ||
isSubtypeOfType(typeMirror, Resource.class.getName());
}
示例4: getTypes
import com.contentful.vault.Resource; //导入依赖的package包/类
@Override
public Map<String, Class<? extends Resource>> getTypes() {
return types;
}