當前位置: 首頁>>代碼示例>>Java>>正文


Java Value.Lazy方法代碼示例

本文整理匯總了Java中org.immutables.value.Value.Lazy方法的典型用法代碼示例。如果您正苦於以下問題:Java Value.Lazy方法的具體用法?Java Value.Lazy怎麽用?Java Value.Lazy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.immutables.value.Value的用法示例。


在下文中一共展示了Value.Lazy方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: factoryOf

import org.immutables.value.Value; //導入方法依賴的package包/類
@Value.Lazy
public AppliedNameForms factoryOf() {
  if (isFactory()) {
    TypeElement enclosingType = (TypeElement) protoclass().sourceElement().getEnclosingElement();

    String invoke = protoclass().kind().isConstructor()
        ? "new"
        : protoclass().sourceElement().getSimpleName().toString();

    return ImmutableConstitution.NameForms.builder()
        .simple(enclosingType.getSimpleName().toString())
        .relativeRaw(enclosingType.getQualifiedName().toString())
        .genericArgs(generics().args())
        .relativeAlreadyQualified(true)
        .packageOf(NA_ERROR)
        .visibility(protoclass().visibility())
        .build()
        .applied(invoke);
  }

  return applyFactoryNaming(names().namings.of);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:23,代碼來源:Constitution.java

示例2: isJacksonSerialized

import org.immutables.value.Value; //導入方法依賴的package包/類
@Value.Lazy
public boolean isJacksonSerialized() {
  if (!styles().style().jacksonIntegration()) {
    return false;
  }
  if (declaringType().isPresent()) {
    DeclaringType t = declaringType().get();
    if (t.isJacksonSerialized()) {
      return true;
    }
    if (t.enclosingTopLevel().isPresent()) {
      if (t.enclosingTopLevel().get().isJacksonSerialized()) {
        return true;
      }
    }
  }
  return packageOf().isJacksonSerialized();
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:19,代碼來源:Proto.java

示例3: typeImmutable

import org.immutables.value.Value; //導入方法依賴的package包/類
/**
 * Actual immutable value type generated implementation.
 * @return immutable implementation type name forms
 */
@Value.Lazy
public NameForms typeImmutable() {
  String simple, relative;

  if (protoclass().kind().isNested()) {
    String enclosingSimpleName = typeImmutableEnclosingSimpleName();
    simple = names().typeImmutableNested();
    relative = inPackage(enclosingSimpleName, simple);
  } else if (hasImmutableInBuilder()) {
    simple = names().typeImmutable;
    relative = inPackage(typeBuilderSimpleName(), simple);
  } else {
    simple = names().typeImmutable;
    relative = inPackage(simple);
  }

  return ImmutableConstitution.NameForms.builder()
      .simple(simple)
      .relativeRaw(relative)
      .genericArgs(generics().args())
      .packageOf(implementationPackage())
      .visibility(implementationVisibility())
      .build();
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:29,代碼來源:Constitution.java

示例4: typeImplementationBuilder

import org.immutables.value.Value; //導入方法依賴的package包/類
@Value.Lazy
public NameForms typeImplementationBuilder() {
  TypeNames names = names();

  boolean outside = isOutsideBuilder();
  boolean nested = protoclass().kind().isNested();

  String simple = typeBuilderSimpleName();
  String relative;

  if (outside && nested) {
    relative = inPackage(typeImmutableEnclosingSimpleName(), simple);
  } else if (outside) {
    relative = inPackage(simple);
  } else if (nested) {
    relative = inPackage(inPackage(typeImmutableEnclosingSimpleName(), names.typeImmutableNested(), simple));
  } else {
    relative = inPackage(inPackage(names.typeImmutable, simple));
  }

  Visibility visibility = builderVisibility();

  return ImmutableConstitution.NameForms.builder()
      .simple(simple)
      .relativeRaw(relative)
      .genericArgs(generics().args())
      .packageOf(implementationPackage())
      .visibility(visibility)
      .build();
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:31,代碼來源:Constitution.java

示例5: typeEnclosing

import org.immutables.value.Value; //導入方法依賴的package包/類
@Value.Lazy
public NameForms typeEnclosing() {
  String name = protoclass().kind().isDefinedValue()
      ? names().typeImmutable
      : names().typeImmutableEnclosing();

  return ImmutableConstitution.NameForms.builder()
      .simple(name)
      .relativeRaw(name)
      .packageOf(implementationPackage())
      .visibility(implementationEnclosingVisibility())
      .build();
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:14,代碼來源:Constitution.java

示例6: isJacksonJsonTypeInfo

import org.immutables.value.Value; //導入方法依賴的package包/類
@Value.Lazy
public boolean isJacksonJsonTypeInfo() {
  if (isJacksonJsonTypeInfoAnnotated(element())) {
    // while DeclaringPackage cannot have those annotations
    // directly, just checking them as a general computation path
    // will not hurt much.
    return true;
  }
  for (MetaAnnotated metaAnnotated : metaAnnotated()) {
    if (metaAnnotated.isJacksonJsonTypeInfo()) {
      return true;
    }
  }
  return false;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:16,代碼來源:Proto.java

示例7: serialVersion

import org.immutables.value.Value; //導入方法依賴的package包/類
@Value.Lazy
public Optional<Long> serialVersion() {
  if (declaringType().isPresent()) {
    DeclaringType t = declaringType().get();
    if (t.serialVersion().isPresent()) {
      return t.serialVersion();
    }
    if (t.enclosingTopLevel().isPresent()) {
      if (t.enclosingTopLevel().get().serialVersion().isPresent()) {
        return t.enclosingTopLevel().get().serialVersion();
      }
    }
  }
  return packageOf().serialVersion();
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:16,代碼來源:Proto.java

示例8: typeAbstract

import org.immutables.value.Value; //導入方法依賴的package包/類
/**
 * Actual abstract value type that is definitive model for the value type.
 * @return abstract value type name forms
 */
@Value.Lazy
public NameForms typeAbstract() {
  if (protoclass().kind().isConstructor()) {
    return typeValue();
  }

  List<String> classSegments = Lists.newArrayListWithExpectedSize(2);
  Element e = SourceNames.collectClassSegments(protoclass().sourceElement(), classSegments);
  verify(e instanceof PackageElement);

  String packageOf = ((PackageElement) e).getQualifiedName().toString();
  String relative = DOT_JOINER.join(classSegments);
  boolean relativeAlreadyQualified = false;

  if (!implementationPackage().equals(packageOf)) {
    relative = DOT_JOINER.join(packageOf, relative);
    relativeAlreadyQualified = true;
  }

  return ImmutableConstitution.NameForms.builder()
      .simple(names().typeAbstract)
      .relativeRaw(relative)
      .packageOf(packageOf)
      .genericArgs(generics().args())
      .relativeAlreadyQualified(relativeAlreadyQualified)
      .visibility(protoclass().visibility())
      .build();
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:33,代碼來源:Constitution.java

示例9: defaultTypeAdapters

import org.immutables.value.Value; //導入方法依賴的package包/類
/**
 * Default type adapters should only be called if {@code Gson.TypeAdapters} annotation is
 * definitely in classpath. Currenlty, it is called by for mongo repository module,
 * which have {@code gson} module as a transitive dependency.
 * @return default type adapters
 */
@Value.Lazy
TypeAdaptersMirror defaultTypeAdapters() {
  @Nullable TypeElement typeElement =
      findElement(TypeAdaptersMirror.qualifiedName());

  Preconditions.checkState(typeElement != null,
      "Processor internal error, @%s is not know to be on the classpath",
      TypeAdaptersMirror.qualifiedName());

  return TypeAdaptersMirror.from(typeElement);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:18,代碼來源:Proto.java

示例10: innerBuilder

import org.immutables.value.Value; //導入方法依賴的package包/類
@Value.Lazy
public InnerBuilderDefinition innerBuilder() {
  return new InnerBuilderDefinition();
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:5,代碼來源:Constitution.java

示例11: typeAdapters

import org.immutables.value.Value; //導入方法依賴的package包/類
@Value.Lazy
public Optional<TypeAdaptersMirror> typeAdapters() {
  return TypeAdaptersMirror.find(element());
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:5,代碼來源:Proto.java

示例12: getLazy

import org.immutables.value.Value; //導入方法依賴的package包/類
@Value.Lazy
public String getLazy() {
  return String.valueOf(getA());
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:5,代碼來源:LazyAttributesSafe.java

示例13: environment

import org.immutables.value.Value; //導入方法依賴的package包/類
@Value.Lazy
public Proto.Environment environment() {
  return ImmutableProto.Environment.of(processing(), this);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:5,代碼來源:Round.java

示例14: hasOkJsonLib

import org.immutables.value.Value; //導入方法依賴的package包/類
@Value.Lazy
public boolean hasOkJsonLib() {
  return findElement("com.squareup.moshi.Moshi") != null;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:5,代碼來源:Proto.java

示例15: repository

import org.immutables.value.Value; //導入方法依賴的package包/類
@Value.Lazy
public Optional<RepositoryMirror> repository() {
  return RepositoryMirror.find(element());
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:5,代碼來源:Proto.java


注:本文中的org.immutables.value.Value.Lazy方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。