Class GenericKubernetesResource

    • Constructor Detail

      • GenericKubernetesResource

        public GenericKubernetesResource()
    • Method Detail

      • getAdditionalProperties

        public Map<String,​Object> getAdditionalProperties()
      • setAdditionalProperties

        public void setAdditionalProperties​(Map<String,​Object> additionalProperties)
      • setAdditionalProperty

        public void setAdditionalProperty​(String name,
                                          Object value)
      • getAdditionalPropertiesNode

        @Deprecated
        public com.fasterxml.jackson.databind.JsonNode getAdditionalPropertiesNode()
        Deprecated.
        use KubernetesSerialization to convert the additionalProperties
      • get

        public <T> T get​(Object... path)
        Allows the retrieval of field values from this Resource for the provided path segments.

        If the path segment is of type Integer, then we assume that it is an array index to retrieve the value of an entry in the array.

        If the path segment is of type String, then we assume that it is a field name to retrieve the value from the resource.

        In any other case, the path segment is ignored and considered invalid. The method returns null.

        Considering the following JSON object:

        
         {
           "field": {
             "value": 42
             "list": [
               {entry: 1}, {entry: 2}, {entry: 3}
             ],
             "1": "one"
           }
         }
         

        The following invocations will produce the documented results:

        • get("field", "value") will result in 42
        • get("field", "1") will result in "one"
        • get("field", 1) will result in null
        • get("field", "list", 1, "entry") will result in 2
        • get("field", "list", 99, "entry") will result in null
        • get("field", "list", "1", "entry") will result in null
        • get("field", "list", 1, false) will result in null
        Type Parameters:
        T - type of the returned object.
        Parameters:
        path - of the field to retrieve.
        Returns:
        the value of the traversed path or null if the field does not exist.
      • get

        public static <T> T get​(Map<String,​Object> root,
                                Object... path)
        The same as get(Object...), but starting at any root raw object
        Type Parameters:
        T - type of the returned object (Map, Collection, or value).
        Parameters:
        root - starting object
        path - of the field to retrieve.
        Returns:
        the value of the traversed path or null if the field does not exist.