Class DefaultJsonServiceProperty<T>

    • Method Detail

      • createFromClass

        @NotNull
        public static <T> @NotNull DefaultJsonServiceProperty<T> createFromClass​(@NotNull
                                                                                 @NotNull java.lang.String key,
                                                                                 @NotNull
                                                                                 @NotNull java.lang.Class<T> classType)
      • createFromType

        @NotNull
        public static <T> @NotNull DefaultJsonServiceProperty<T> createFromType​(@NotNull
                                                                                @NotNull java.lang.String key,
                                                                                @NotNull
                                                                                @NotNull java.lang.reflect.Type type)
      • createFromType

        @NotNull
        public static <T> @NotNull DefaultJsonServiceProperty<T> createFromType​(@NotNull
                                                                                @NotNull java.lang.String key,
                                                                                @NotNull
                                                                                @NotNull java.lang.reflect.Type type,
                                                                                boolean forbidModifications)
      • get

        @NotNull
        public @NotNull java.util.Optional<T> get​(@NotNull
                                                  @NotNull ServiceInfoSnapshot serviceInfoSnapshot)
        Description copied from interface: ServiceProperty
        Gets a property out of the properties of the given ServiceInfoSnapshot.
        Specified by:
        get in interface ServiceProperty<T>
        Parameters:
        serviceInfoSnapshot - the serviceInfoSnapshot to get the property
        Returns:
        an optional with the value, might be empty
      • set

        public void set​(@NotNull
                        @NotNull ServiceInfoSnapshot serviceInfoSnapshot,
                        T value)
        Description copied from interface: ServiceProperty
        Sets a property into the properties of the given ServiceInfoSnapshot. Some properties might not support this. An update of the service might be necessary.
        Specified by:
        set in interface ServiceProperty<T>
        Parameters:
        serviceInfoSnapshot - the serviceInfoSnapshot to modify the property in
        value - the value to set or null to remove the property