Class PropertyMaps

java.lang.Object
org.micromanager.PropertyMaps

public final class PropertyMaps extends Object
Static methods to create PropertyMap instances.
  • Method Details

    • builder

      public static PropertyMap.Builder builder()
      Returns a builder object for creating PropertyMap instances.

      Create property maps like this:

      PropertyMap myPropertyMap = PropertyMaps.builder().
            putString("first name", "Jane").
            putString("last name", "Smith").
            putInteger("age", 32).
            build();
      
      Returns:
      a property map builder
    • emptyPropertyMap

      public static PropertyMap emptyPropertyMap()
      Return the empty property map.
      Returns:
      empty property map
    • fromJSON

      public static PropertyMap fromJSON(String json) throws IOException
      Create a property map from its JSON-serialized form.
      Parameters:
      json - json formatted String to be converted into a PropertyMap
      Returns:
      PropertyMap result from conversion
      Throws:
      IOException - if json is invalid JSON or if it does not represent a valid property map
    • loadJSON

      public static PropertyMap loadJSON(File file) throws IOException
      Create a property map from its JSON-serialized form stored in a file.
      Parameters:
      file - File containing the serialized JSON PropertyMap
      Returns:
      Deserialized PropertyMap
      Throws:
      IOException - if there was a problem reading file or if the file contained invalid JSON or if the JSON did not represent a valid property map
      FileNotFoundException - this subclass of IOException is thrown if file does not exist