org.springframework.boot.context.config

Class Profiles

  • java.lang.Object
    • org.springframework.boot.context.config.Profiles
  • All Implemented Interfaces:
    java.lang.Iterable<java.lang.String>


    public class Profiles
    extends java.lang.Object
    implements java.lang.Iterable<java.lang.String>
    Provides access to environment profiles that have either been set directly on the Environment or will be set based on configuration data property values.
    Since:
    2.4.0
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String INCLUDE_PROFILES_PROPERTY_NAME
      Name of property to set to specify additionally included active profiles.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.util.List<java.lang.String> getAccepted()
      Return the accepted profiles.
      java.util.List<java.lang.String> getActive()
      Return the active profiles.
      java.util.List<java.lang.String> getDefault()
      Return the default profiles.
      boolean isAccepted(java.lang.String profile)
      Return if the given profile is active.
      java.util.Iterator<java.lang.String> iterator()
      Return an iterator for all accepted profiles.
      java.lang.String toString() 
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Field Detail

      • INCLUDE_PROFILES_PROPERTY_NAME

        public static final java.lang.String INCLUDE_PROFILES_PROPERTY_NAME
        Name of property to set to specify additionally included active profiles.
        See Also:
        Constant Field Values
    • Method Detail

      • iterator

        public java.util.Iterator<java.lang.String> iterator()
        Return an iterator for all accepted profiles.
        Specified by:
        iterator in interface java.lang.Iterable<java.lang.String>
      • getActive

        public java.util.List<java.lang.String> getActive()
        Return the active profiles.
        Returns:
        the active profiles
      • getDefault

        public java.util.List<java.lang.String> getDefault()
        Return the default profiles.
        Returns:
        the active profiles
      • getAccepted

        public java.util.List<java.lang.String> getAccepted()
        Return the accepted profiles.
        Returns:
        the accepted profiles
      • isAccepted

        public boolean isAccepted(java.lang.String profile)
        Return if the given profile is active.
        Parameters:
        profile - the profile to test
        Returns:
        if the profile is active
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object