Package org.jf.dexlib2.immutable
Class ImmutableField
- java.lang.Object
-
- org.jf.dexlib2.base.reference.BaseReference
-
- org.jf.dexlib2.base.reference.BaseFieldReference
-
- org.jf.dexlib2.immutable.ImmutableField
-
- All Implemented Interfaces:
java.lang.Comparable<FieldReference>,Annotatable,Field,Member,FieldReference,Reference
public class ImmutableField extends BaseFieldReference implements Field
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jf.dexlib2.iface.reference.Reference
Reference.InvalidReferenceException
-
-
Field Summary
Fields Modifier and Type Field Description protected intaccessFlagsprotected com.google.common.collect.ImmutableSet<? extends ImmutableAnnotation>annotationsprotected java.lang.StringdefiningClassprotected com.google.common.collect.ImmutableSet<HiddenApiRestriction>hiddenApiRestrictionsprotected ImmutableEncodedValueinitialValueprotected java.lang.Stringnameprotected java.lang.Stringtype
-
Constructor Summary
Constructors Constructor Description ImmutableField(java.lang.String definingClass, java.lang.String name, java.lang.String type, int accessFlags, EncodedValue initialValue, java.util.Collection<? extends Annotation> annotations, java.util.Set<HiddenApiRestriction> hiddenApiRestrictions)ImmutableField(java.lang.String definingClass, java.lang.String name, java.lang.String type, int accessFlags, ImmutableEncodedValue initialValue, com.google.common.collect.ImmutableSet<? extends ImmutableAnnotation> annotations, com.google.common.collect.ImmutableSet<HiddenApiRestriction> hiddenApiRestrictions)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetAccessFlags()Gets the access flags for this field.com.google.common.collect.ImmutableSet<? extends ImmutableAnnotation>getAnnotations()Gets a set of the annotations that are applied to this field.java.lang.StringgetDefiningClass()Gets the type of the class that defines this field.java.util.Set<HiddenApiRestriction>getHiddenApiRestrictions()Gets the hidden api restrictions for this field.EncodedValuegetInitialValue()Gets the initial value for this field, if available.java.lang.StringgetName()Gets the name of this field.java.lang.StringgetType()Gets the type of this field.static com.google.common.collect.ImmutableSortedSet<ImmutableField>immutableSetOf(java.lang.Iterable<? extends Field> list)static ImmutableFieldof(Field field)-
Methods inherited from class org.jf.dexlib2.base.reference.BaseFieldReference
compareTo, equals, hashCode, toString
-
Methods inherited from class org.jf.dexlib2.base.reference.BaseReference
validateReference
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.jf.dexlib2.iface.reference.FieldReference
compareTo, equals, hashCode
-
Methods inherited from interface org.jf.dexlib2.iface.reference.Reference
validateReference
-
-
-
-
Field Detail
-
definingClass
@Nonnull protected final java.lang.String definingClass
-
name
@Nonnull protected final java.lang.String name
-
type
@Nonnull protected final java.lang.String type
-
accessFlags
protected final int accessFlags
-
initialValue
@Nullable protected final ImmutableEncodedValue initialValue
-
annotations
@Nonnull protected final com.google.common.collect.ImmutableSet<? extends ImmutableAnnotation> annotations
-
hiddenApiRestrictions
@Nonnull protected final com.google.common.collect.ImmutableSet<HiddenApiRestriction> hiddenApiRestrictions
-
-
Constructor Detail
-
ImmutableField
public ImmutableField(@Nonnull java.lang.String definingClass, @Nonnull java.lang.String name, @Nonnull java.lang.String type, int accessFlags, @Nullable EncodedValue initialValue, @Nullable java.util.Collection<? extends Annotation> annotations, @Nullable java.util.Set<HiddenApiRestriction> hiddenApiRestrictions)
-
ImmutableField
public ImmutableField(@Nonnull java.lang.String definingClass, @Nonnull java.lang.String name, @Nonnull java.lang.String type, int accessFlags, @Nullable ImmutableEncodedValue initialValue, @Nullable com.google.common.collect.ImmutableSet<? extends ImmutableAnnotation> annotations, @Nullable com.google.common.collect.ImmutableSet<HiddenApiRestriction> hiddenApiRestrictions)
-
-
Method Detail
-
of
public static ImmutableField of(Field field)
-
getDefiningClass
@Nonnull public java.lang.String getDefiningClass()
Description copied from interface:FieldGets the type of the class that defines this field.- Specified by:
getDefiningClassin interfaceField- Specified by:
getDefiningClassin interfaceFieldReference- Specified by:
getDefiningClassin interfaceMember- Returns:
- The type of the class that defines this field
-
getName
@Nonnull public java.lang.String getName()
Description copied from interface:FieldGets the name of this field.
-
getType
@Nonnull public java.lang.String getType()
Description copied from interface:FieldGets the type of this field.- Specified by:
getTypein interfaceField- Specified by:
getTypein interfaceFieldReference- Returns:
- The type of this field
-
getAccessFlags
public int getAccessFlags()
Description copied from interface:FieldGets the access flags for this field. This will be a combination of the AccessFlags.* flags that are marked as compatible for use with a field.- Specified by:
getAccessFlagsin interfaceField- Specified by:
getAccessFlagsin interfaceMember- Returns:
- The access flags for this field
-
getInitialValue
public EncodedValue getInitialValue()
Description copied from interface:FieldGets the initial value for this field, if available. Only static field may have an initial value set, but are not required to have an initial value.- Specified by:
getInitialValuein interfaceField- Returns:
- The initial value for this field, or null if this field is not a static field, or if this static field does not have an initial value.
-
getAnnotations
@Nonnull public com.google.common.collect.ImmutableSet<? extends ImmutableAnnotation> getAnnotations()
Description copied from interface:FieldGets a set of the annotations that are applied to this field. The annotations in the returned set are guaranteed to have unique types.- Specified by:
getAnnotationsin interfaceAnnotatable- Specified by:
getAnnotationsin interfaceField- Returns:
- A set of the annotations that are applied to this field
-
getHiddenApiRestrictions
@Nonnull public java.util.Set<HiddenApiRestriction> getHiddenApiRestrictions()
Description copied from interface:FieldGets the hidden api restrictions for this field. This will contain at most 1 normal flag (with isDomainSpecificApiFlag() = false), and 1 domain-specific api flag (with isDomainSpecificApiFlag() = true)- Specified by:
getHiddenApiRestrictionsin interfaceField- Specified by:
getHiddenApiRestrictionsin interfaceMember- Returns:
- A set of the hidden api restrictions for this field.
-
immutableSetOf
@Nonnull public static com.google.common.collect.ImmutableSortedSet<ImmutableField> immutableSetOf(@Nullable java.lang.Iterable<? extends Field> list)
-
-