Java Code Examples for org.immutables.value.Value#Auxiliary

The following examples show how to use org.immutables.value.Value#Auxiliary . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Proto.java    From immutables with Apache License 2.0 5 votes vote down vote up
/**
 * Element used mostly for error reporting,
 * real model provided by {@link #sourceElement()}.
 */
@Value.Derived
@Value.Auxiliary
@Override
public Element element() {
  if (kind().isFactory()) {
    return sourceElement();
  }
  if (declaringType().isPresent()) {
    return declaringType().get().element();
  }
  return packageOf().element();
}
 
Example 2
Source File: SharedSecret.java    From quilt with Apache License 2.0 5 votes vote down vote up
/**
 * 32-byte key for encryption/decryption within Java.
 *
 * @return key bytes
 */
@Value.Derived
@Value.Auxiliary
default byte[] key() {
  // both base64 and base64 url encoded keys are allowed by the rfc
  try {
    return Base64.getDecoder().decode(value());
  } catch (IllegalArgumentException e) {
    try {
      return Base64.getUrlDecoder().decode(value());
    } catch (IllegalArgumentException ex) {
      throw new IllegalArgumentException("SharedSecret must be base64 encoded");
    }
  }
}
 
Example 3
Source File: AsyncVersionedTargetGraphBuilder.java    From buck with Apache License 2.0 4 votes vote down vote up
@Value.Auxiliary
public abstract Optional<TargetNodeTranslator> targetNodeTranslator();
 
Example 4
Source File: ArchiveMemberPath.java    From buck with Apache License 2.0 4 votes vote down vote up
@Value.Auxiliary
public boolean isAbsolute() {
  return getArchivePath().isAbsolute();
}
 
Example 5
Source File: CellImpl.java    From buck with Apache License 2.0 4 votes vote down vote up
@Override
@Value.Auxiliary
public abstract CanonicalCellName getCanonicalName();
 
Example 6
Source File: Proto.java    From immutables with Apache License 2.0 4 votes vote down vote up
@Override
@Value.Auxiliary
public abstract Element element();
 
Example 7
Source File: Proto.java    From immutables with Apache License 2.0 4 votes vote down vote up
@Value.Derived
@Value.Auxiliary
public boolean isSerialStructural() {
  return environment().hasSerialModule()
      && StructuralMirror.isPresent(element());
}
 
Example 8
Source File: Proto.java    From immutables with Apache License 2.0 4 votes vote down vote up
@Value.Parameter
@Value.Auxiliary
public abstract String qualifiedName();
 
Example 9
Source File: BasicAuthHeader.java    From judgels with GNU General Public License v2.0 4 votes vote down vote up
@Value.Auxiliary
public abstract Client getClient();
 
Example 10
Source File: PythonMappedComponents.java    From buck with Apache License 2.0 4 votes vote down vote up
@AddToRuleKey
@Value.Derived
@Value.Auxiliary
public Supplier<ImmutableSortedMap<String, SourcePath>> getComponentsRuleKey() {
  return () -> MoreMaps.transformKeysAndSort(getComponents(), Path::toString);
}
 
Example 11
Source File: CellImpl.java    From buck with Apache License 2.0 4 votes vote down vote up
@Override
@Value.Auxiliary
public abstract ToolchainProvider getToolchainProvider();
 
Example 12
Source File: CamelScheme.java    From camel-k-runtime with Apache License 2.0 4 votes vote down vote up
@Value.Auxiliary
@Value.Default
default boolean http() {
    return false;
}
 
Example 13
Source File: CamelLoader.java    From camel-k-runtime with Apache License 2.0 4 votes vote down vote up
@Value.Auxiliary
@Value.Default
default Set<String> getLanguages() {
    return Collections.emptySet();
}
 
Example 14
Source File: EcrfDatamodelField.java    From hmftools with GNU General Public License v3.0 4 votes vote down vote up
@Value.Auxiliary
@NotNull
public abstract Map<Integer, String> codeList();
 
Example 15
Source File: CamelArtifact.java    From camel-k-runtime with Apache License 2.0 4 votes vote down vote up
@Value.Auxiliary
@Value.Default
default Set<String> getJavaTypes() {
    return Collections.emptySet();
}
 
Example 16
Source File: CamelArtifact.java    From camel-k-runtime with Apache License 2.0 4 votes vote down vote up
@Value.Auxiliary
@Value.Default
default Set<Artifact> getExclusions() {
    return Collections.emptySet();
}
 
Example 17
Source File: DescriptionProvider.java    From waltz with Apache License 2.0 4 votes vote down vote up
@Value
@Value.Auxiliary
@Nullable
String description();
 
Example 18
Source File: CamelArtifact.java    From camel-k-runtime with Apache License 2.0 4 votes vote down vote up
@Value.Auxiliary
@Value.Default
default Set<String> getLanguages() {
    return Collections.emptySet();
}
 
Example 19
Source File: CxxSymlinkTreeHeaders.java    From buck with Apache License 2.0 4 votes vote down vote up
@Value.Auxiliary
@CustomFieldBehavior(NameToPathMapInputsBehavior.class)
public abstract ImmutableSortedMap<Path, SourcePath> getNameToPathMap();
 
Example 20
Source File: UserFlavor.java    From buck with Apache License 2.0 4 votes vote down vote up
@Value.Auxiliary
@JsonProperty("description")
public abstract String getDescription();