Class TargetEnvironment


  • public final class TargetEnvironment
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String arch  
      private java.lang.String os  
      private static java.lang.String OSGI_ARCH  
      private static java.lang.String OSGI_OS  
      private static java.lang.String OSGI_WS  
      private java.lang.String ws  
    • Constructor Summary

      Constructors 
      Constructor Description
      TargetEnvironment()  
      TargetEnvironment​(java.lang.String os, java.lang.String ws, java.lang.String arch)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private static boolean eq​(java.lang.String a, java.lang.String b)  
      boolean equals​(java.lang.Object obj)  
      java.lang.String getArch()
      Returns the architecture of the represented target environment.
      java.lang.String getOs()
      Returns the operating system of the represented target environment.
      static TargetEnvironment getRunningEnvironment()  
      java.lang.String getWs()
      Returns the windowing system of the represented target environment.
      int hashCode()  
      boolean match​(java.lang.String os, java.lang.String ws, java.lang.String arch)  
      java.lang.String toConfigSpec()
      Returns the target environment as string of the form ws.os.arch.
      java.lang.String toFilterExpression()
      Returns the target environment as LDAP filter expression.
      java.util.HashMap<java.lang.String,​java.lang.String> toFilterProperties()
      Returns the target environment as map.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • os

        private java.lang.String os
      • ws

        private java.lang.String ws
      • arch

        private java.lang.String arch
    • Constructor Detail

      • TargetEnvironment

        public TargetEnvironment()
      • TargetEnvironment

        public TargetEnvironment​(java.lang.String os,
                                 java.lang.String ws,
                                 java.lang.String arch)
    • Method Detail

      • getOs

        public java.lang.String getOs()
        Returns the operating system of the represented target environment.
      • getWs

        public java.lang.String getWs()
        Returns the windowing system of the represented target environment.
      • getArch

        public java.lang.String getArch()
        Returns the architecture of the represented target environment.
      • match

        public boolean match​(java.lang.String os,
                             java.lang.String ws,
                             java.lang.String arch)
      • toConfigSpec

        public java.lang.String toConfigSpec()
        Returns the target environment as string of the form ws.os.arch. This format is used by the p2 publishers and in that context called "configuration" or "config spec".
      • toFilterProperties

        public java.util.HashMap<java.lang.String,​java.lang.String> toFilterProperties()
        Returns the target environment as map. The keys are "osgi.ws", "osgi.os", and "osgi.arch". This format is used by the p2 slicer to filter installable units by environments.
        Returns:
        a new instance of HashMap with the target environment set
      • toFilterExpression

        public java.lang.String toFilterExpression()
        Returns the target environment as LDAP filter expression. This format is used in p2 metadata.
        Returns:
        the LDAP that evaluates to true when installing for this target environment.
      • toString

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

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • eq

        private static boolean eq​(java.lang.String a,
                                  java.lang.String b)