本文整理匯總了Java中org.immutables.value.Value.Derived方法的典型用法代碼示例。如果您正苦於以下問題:Java Value.Derived方法的具體用法?Java Value.Derived怎麽用?Java Value.Derived使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.immutables.value.Value
的用法示例。
在下文中一共展示了Value.Derived方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: simple
import org.immutables.value.Value; //導入方法依賴的package包/類
@Override
@Value.Derived
public String simple() {
return isNew()
? (NEW_KEYWORD + ' ' + forms().simple())
: applied();
}
示例2: implementationVisibility
import org.immutables.value.Value; //導入方法依賴的package包/類
@Value.Derived
public Visibility implementationVisibility() {
if (style().visibility() == ImplementationVisibility.PRIVATE
&& !protoclass().features().builder()
&& !protoclass().kind().isNested()) {
protoclass()
.report()
.warning("effective Style.visibility cannot be PRIVATE when builder is disabled and is not nested,"
+ " automatically switching visibility to PACKAGE because top level implementation class is required");
return Visibility.PACKAGE;
}
return protoclass().visibility().forImplementation(style().visibility());
}
示例3: docEventsToCorpusEvents
import org.immutables.value.Value; //導入方法依賴的package包/類
@Value.Derived
public ImmutableMultimap<DocEventFrameReference, CorpusEventFrame> docEventsToCorpusEvents() {
final ImmutableMultimap.Builder<DocEventFrameReference, CorpusEventFrame> ret =
ImmutableMultimap.builder();
for (final CorpusEventFrame corpusEventFrame : corpusEventFrames()) {
for (final DocEventFrameReference docEventFrameReference : corpusEventFrame
.docEventFrames()) {
ret.put(docEventFrameReference, corpusEventFrame);
}
}
return ret.build();
}
示例4: defaultStyles
import org.immutables.value.Value; //導入方法依賴的package包/類
@Value.Derived
StyleInfo defaultStyles() {
@Nullable TypeElement element = findElement(StyleMirror.qualifiedName());
if (element == null) {
processing().getMessager()
.printMessage(Diagnostic.Kind.MANDATORY_WARNING,
"Could not found annotations on the compile classpath. It looks like annotation processor is running"
+ " in a separate annotation-processing classpath and unable to get to annotation definitions."
+ " To fix this, please add annotation-only artifact 'org.immutables:value:(version):annotations'"
+ " to 'compile' 'compileOnly' or 'provided' dependency scope.");
element = findElement(StyleMirror.mirrorQualifiedName());
verify(element != null, "Classpath should contain at least mirror annotation, otherwise library is corrupted");
}
try {
return ToStyleInfo.FUNCTION.apply(StyleMirror.from(element));
} catch (Exception ex) {
processing().getMessager()
.printMessage(Diagnostic.Kind.MANDATORY_WARNING,
"The version of the Immutables annotation on the classpath has incompatible differences"
+ " from the Immutables annotation processor used. Various problems might occur,"
+ " like this one: "
+ ex);
element = findElement(StyleMirror.mirrorQualifiedName());
verify(element != null,
"classpath should contain at least the mirror annotation, otherwise library is corrupted");
return ToStyleInfo.FUNCTION.apply(StyleMirror.from(element));
}
}
示例5: visibility
import org.immutables.value.Value; //導入方法依賴的package包/類
@Value.Derived
public Visibility visibility() {
return Visibility.of(sourceElement());
}
示例6: qualifiedName
import org.immutables.value.Value; //導入方法依賴的package包/類
@Value.Derived
String qualifiedName() {
return element().getQualifiedName().toString();
}
示例7: isTopLevel
import org.immutables.value.Value; //導入方法依賴的package包/類
/**
* @return true, if is top level
*/
@Value.Derived
@Value.Auxiliary
public boolean isTopLevel() {
return element().getNestingKind() == NestingKind.TOP_LEVEL;
}
示例8: derived
import org.immutables.value.Value; //導入方法依賴的package包/類
@Value.Derived
default int derived() {
return v1().or(0);
}
示例9: a
import org.immutables.value.Value; //導入方法依賴的package包/類
@Value.Derived
default int a() {
return 1;
}
示例10: getKeyword
import org.immutables.value.Value; //導入方法依賴的package包/類
@Override
@Value.Derived
public String getKeyword() {
return "enum";
}
示例11: simpleName
import org.immutables.value.Value; //導入方法依賴的package包/類
@Value.Auxiliary
@Value.Derived
public String simpleName() {
return element().getSimpleName().toString();
}
示例12: builderVisibility
import org.immutables.value.Value; //導入方法依賴的package包/類
@Value.Derived
public Visibility builderVisibility() {
return protoclass().visibility().forBuilder(style().builderVisibility());
}
示例13: docIDs
import org.immutables.value.Value; //導入方法依賴的package包/類
/**
* @return A derived set from {@link #queryReponses()} of Document IDs
*/
@Value.Derived
public ImmutableSet<Symbol> docIDs() {
return FluentIterable.from(queryReponses()).index(QueryResponse2016Functions.docID()).keySet();
}
示例14: simpleName
import org.immutables.value.Value; //導入方法依賴的package包/類
@Value.Derived
String simpleName() {
return element().getSimpleName().toString();
}
示例15: getType
import org.immutables.value.Value; //導入方法依賴的package包/類
@Override
@Value.Derived
public TSTargetType getType() {
return ENUM_MEMBER;
}