Class Fill

java.lang.Object
net.pl3x.map.core.markers.option.Option<@NotNull Fill>
net.pl3x.map.core.markers.option.Fill
All Implemented Interfaces:
JsonSerializable

public class Fill extends Option<@NotNull Fill>
Fill properties of a marker.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Fill type.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create a fill rule with default options.
    Fill(boolean enabled)
    Create a fill rule.
    Fill(int color)
    Create a fill rule.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    equals(@Nullable Object o)
     
    static @NotNull Fill
    fromJson(@NotNull com.google.gson.JsonObject obj)
     
    @Nullable Integer
    Get the fill color of this fill rule.
    @Nullable Fill.Type
    Get the fill type of this fill rule.
    int
     
    boolean
    Check whether all options are defaults (all are null)
    @Nullable Boolean
    Whether to fill the path with color.
    @NotNull Fill
    setColor(@Nullable Integer color)
    Set a new color for this fill rule.
    @NotNull Fill
    setEnabled(@Nullable Boolean enabled)
    Set whether to fill the path with color.
    @NotNull Fill
    setType(@Nullable Fill.Type type)
    Set a new fill type for this fill rule.
    @NotNull com.google.gson.JsonObject
    Jsonify this object.
    @NotNull String
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Fill

      public Fill()
      Create a fill rule with default options.
    • Fill

      public Fill(boolean enabled)
      Create a fill rule.
    • Fill

      public Fill(int color)
      Create a fill rule.
      Parameters:
      color - argb color
  • Method Details

    • isEnabled

      @Nullable public @Nullable Boolean isEnabled()
      Whether to fill the path with color.

      Defaults to 'true' if null.

      Returns:
      true if fill is enabled
    • setEnabled

      @NotNull public @NotNull Fill setEnabled(@Nullable @Nullable Boolean enabled)
      Set whether to fill the path with color.

      Setting to false will disable filling on polygons or circles.

      Defaults to 'true' if null.

      Parameters:
      enabled - whether fill is enabled
      Returns:
      this fill rule
    • getType

      @Nullable public @Nullable Fill.Type getType()
      Get the fill type of this fill rule.

      Defaults to 'Fill.Type.EVENODD' if null.

      Returns:
      fill type
      See Also:
    • setType

      @NotNull public @NotNull Fill setType(@Nullable @Nullable Fill.Type type)
      Set a new fill type for this fill rule.

      Defaults to 'Fill.Type.EVENODD' if null.

      Parameters:
      type - new fill type
      Returns:
      this fill rule
      See Also:
    • getColor

      @Nullable public @Nullable Integer getColor()
      Get the fill color of this fill rule.

      Defaults to 'Stroke.getColor()' if null.

      Returns:
      argb color
    • setColor

      @NotNull public @NotNull Fill setColor(@Nullable @Nullable Integer color)
      Set a new color for this fill rule.

      Defaults to 'Stroke.getColor()' if null.

      Parameters:
      color - new argb color
      Returns:
      this fill rule
    • isDefault

      public boolean isDefault()
      Description copied from class: Option
      Check whether all options are defaults (all are null)
      Specified by:
      isDefault in class Option<@NotNull Fill>
      Returns:
      true if all options are null
    • toJson

      @NotNull public @NotNull com.google.gson.JsonObject toJson()
      Description copied from interface: JsonSerializable
      Jsonify this object.
      Returns:
      object as json element
    • fromJson

      @NotNull public static @NotNull Fill fromJson(@NotNull @NotNull com.google.gson.JsonObject obj)
    • equals

      public boolean equals(@Nullable @Nullable Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      @NotNull public @NotNull String toString()
      Overrides:
      toString in class Object