/** * Specifies information about a type which may be a container specified by generic type arguments, * e.g. {@link com.google.errorprone.annotations.Immutable}. * * <p>Useful for providing information for immutable classes we can't easily annotate, e.g. those in * the JDK. */ @AutoValue @Immutable public abstract class AnnotationInfo { public abstract String typeName(); public Set<String> containerOf() { return internalContainerOf(); } abstract ImmutableSet<String> internalContainerOf(); public static AnnotationInfo create(String typeName, Iterable<String> containerOf) { return new AutoValue_AnnotationInfo(typeName, ImmutableSet.copyOf(containerOf)); } public static AnnotationInfo create(String typeName) { return create(typeName, ImmutableSet.<String>of()); } }
/** * Explicitly named subinterface of {@link Supplier} that can be marked {@literal @}{@link * Immutable}. */ @Immutable interface ImmutableSupplier<T> extends Supplier<T> {}
/** Holder of min and max size maps for each {@link SizeConfiguration}. */ @Immutable @AutoValue @AutoValue.CopyAnnotations public abstract class ConfigurationSizes { public abstract ImmutableMap<SizeConfiguration, Long> getMinSizeConfigurationMap(); public abstract ImmutableMap<SizeConfiguration, Long> getMaxSizeConfigurationMap(); public static ConfigurationSizes create( ImmutableMap<SizeConfiguration, Long> minSizeConfigurationMap, ImmutableMap<SizeConfiguration, Long> maxSizeConfigurationMap) { return new AutoValue_ConfigurationSizes(minSizeConfigurationMap, maxSizeConfigurationMap); } }
/** * Explicitly named subinterface of {@link Supplier} that can be marked {@literal @}{@link * Immutable}. */ @Immutable interface ImmutableSupplier<T> extends Supplier<T> {}
/** A {@link BundleModule} condition describing a certain device feature. */ @Immutable @AutoValue @AutoValue.CopyAnnotations public abstract class DeviceFeatureCondition { public abstract String getFeatureName(); public abstract Optional<Integer> getFeatureVersion(); public static DeviceFeatureCondition create(String featureName) { return new AutoValue_DeviceFeatureCondition(featureName, Optional.empty()); } public static DeviceFeatureCondition create(String featureName, Optional<Integer> version) { return new AutoValue_DeviceFeatureCondition(featureName, version); } }
/** * Explicitly named subinterface of {@link Supplier} that can be marked {@literal @}{@link * Immutable}. */ @Immutable interface ImmutableSupplier<T> extends Supplier<T> {}
/** Represents an entry in a resource table. */ @Immutable @AutoValue @AutoValue.CopyAnnotations public abstract class ResourceTableEntry { public static ResourceTableEntry create(Resources.Package pkg, Type type, Entry entry) { return new AutoValue_ResourceTableEntry(pkg, type, entry); } public abstract Resources.Package getPackage(); public abstract Type getType(); public abstract Entry getEntry(); @Memoized public ResourceId getResourceId() { return ResourceId.create(getPackage(), getType(), getEntry()); } }
@Immutable static final class ResourceMethod implements Comparable<ResourceMethod> { @SuppressWarnings("Immutable") final @Nullable ClassName typeName; final String name; final boolean requiresResources; final int sdk; ResourceMethod(@Nullable ClassName typeName, String name, boolean requiresResources, int sdk) { this.typeName = typeName; this.name = name; this.requiresResources = requiresResources; this.sdk = sdk; } @Override public int compareTo(ResourceMethod other) { return Integer.compare(sdk, other.sdk); } }
/** * A {@link BundleModule} condition describing a set of user countries. * * <p>The list of country codes can be inclusive or exclusive. The country codes must follow the * CLDR territory two-letter string format. */ @Immutable @AutoValue @AutoValue.CopyAnnotations public abstract class UserCountriesCondition { public abstract ImmutableList<String> getCountries(); public abstract boolean getExclude(); public static UserCountriesCondition create( ImmutableList<String> countryCodeList, boolean exclude) { return new AutoValue_UserCountriesCondition(countryCodeList, exclude); } }
/** * Explicitly named subinterface of {@link Supplier} that can be marked {@literal @}{@link * Immutable}. */ @Immutable interface ImmutableSupplier<T> extends Supplier<T> {}
@Immutable abstract class AbstractHashFunction implements HashFunction { @Override
@Immutable final class ChecksumHashFunction extends AbstractHashFunction implements Serializable { private final ImmutableSupplier<? extends Checksum> checksumSupplier;
@Immutable abstract class AbstractNonStreamingHashFunction extends AbstractHashFunction { @Override