Class BasicRegionConfig

    • Constructor Detail

      • BasicRegionConfig

        public BasicRegionConfig()
    • Method Detail

      • isValid

        public boolean isValid()
        Description copied from class: Config
        Indicates whether or not the backing JSON node contains valid data.

        Default implementation returns true. Subclasses are expected to override this with their own validation. Implementations are free to throw a RuntimeException if data is invalid.

        Overrides:
        isValid in class BasicElementConfig<RegionId>
        Returns:
        true if the data is valid; false otherwise
      • type

        public Region.Type type()
        Returns the region type.
        Returns:
        the region type
      • type

        public BasicRegionConfig type​(Region.Type type)
        Sets the region type.
        Parameters:
        type - the region type, or null to unset
        Returns:
        the config of the region
      • devices

        public java.util.List<DeviceId> devices()
        Returns the identities of the devices in this region.
        Returns:
        list of device identifiers
      • devices

        public BasicRegionConfig devices​(java.util.Set<DeviceId> devices)
        Sets the devices of this region.
        Parameters:
        devices - the device identifiers, or null to unset
        Returns:
        the config of the region
      • addPeerLocMapping

        public BasicRegionConfig addPeerLocMapping​(java.lang.String peerId,
                                                   java.lang.String locType,
                                                   java.lang.Double latOrY,
                                                   java.lang.Double longOrX)
        Adds a peer location mapping to this region.
        Parameters:
        peerId - the region ID of the peer
        locType - the type of location (geo/grid)
        latOrY - geo latitude / grid y-coord
        longOrX - geo longitude / grid x-coord
        Returns:
        self
      • getMappings

        public java.util.List<LayoutLocation> getMappings()
        Returns the list of layout location mappings for where peer region nodes should be placed on the layout when viewing this region.
        Returns:
        list of peer node locations