Interface PlatformTarget

  • All Superinterfaces:
    Predicate<Platform>
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface PlatformTarget
    extends Predicate<Platform>
    Platform target.

    This allows you to target a certain platform or restrict a feature to a certain platform.

    • Method Detail

      • all

        @Contract(pure=true)
        @NotNull
        static @NotNull PlatformTarget all()
        Create a new platform target that matches all platforms.
        Returns:
        new platform target.
      • none

        @Contract(pure=true)
        @NotNull
        static @NotNull PlatformTarget none()
        Create a new platform target that matches nothing.
        Returns:
        new platform target.
      • proxy

        @Contract(pure=true)
        @NotNull
        static @NotNull PlatformTarget proxy()
        Create a new platform target that matches all proxy platforms.
        Returns:
        new platform target.
      • server

        @Contract(pure=true)
        @NotNull
        static @NotNull PlatformTarget server()
        Create a new platform target that matches all server platforms.
        Returns:
        new platform target.
      • bukkit

        @Contract(pure=true)
        @NotNull
        static @NotNull PlatformTarget bukkit()
        Create a new platform target that matches Bukkit.
        Returns:
        new platform target.
      • bungeeCord

        @Contract(pure=true)
        @NotNull
        static @NotNull PlatformTarget bungeeCord()
        Create a new platform target that matches BungeeCord.
        Returns:
        new platform target.
      • folia

        @Contract(pure=true)
        @NotNull
        static @NotNull PlatformTarget folia()
        Create a new platform target that matches Folia.
        Returns:
        new platform target.
      • nukkit

        @Contract(pure=true)
        @NotNull
        static @NotNull PlatformTarget nukkit()
        Create a new platform target that matches Nukkit.
        Returns:
        new platform target.
      • sponge

        @Contract(pure=true)
        @NotNull
        static @NotNull PlatformTarget sponge()
        Create a new platform target that matches Sponge.
        Returns:
        new platform target.
      • velocity

        @Contract(pure=true)
        @NotNull
        static @NotNull PlatformTarget velocity()
        Create a new platform target that matches Sponge.
        Returns:
        new platform target.
      • id

        @Contract(pure=true)
        @NotNull
        static @NotNull PlatformTarget id​(@NotNull
                                          @NotNull String id)
        Create a new platform target that matches platforms with the given id.
        Parameters:
        id - Target platform identifier.
        Returns:
        new platform target.
      • id

        @Contract(pure=true)
        @NotNull
        static @NotNull PlatformTarget id​(@NotNull
                                          @NotNull String id,
                                          boolean strict)
        Create a new platform target that matches platforms with the given id.
        Parameters:
        id - Target platform identifier.
        strict - Whether the id equality should be case-sensitive.
        Returns:
        new platform target.
      • test

        boolean test​(@NotNull
                     @NotNull Platform platform)
        Check if the given platform matches this target.
        Specified by:
        test in interface Predicate<Platform>
        Parameters:
        platform - Platform.
        Returns:
        true if the given platform matches this target, otherwise false.
      • and

        @Contract(value="_ -> new",
                  pure=true)
        @NotNull
        default @NotNull PlatformTarget and​(@NotNull
                                            @NotNull PlatformTarget other)
        Returns a new platform target that matches this target, and the other target.
        Parameters:
        other - Other platform target.
        Returns:
        new platform target.
      • or

        @Contract(value="_ -> new",
                  pure=true)
        @NotNull
        default @NotNull PlatformTarget or​(@NotNull
                                           @NotNull PlatformTarget other)
        Returns a new platform target that matches this target, or the other target.
        Parameters:
        other - Other platform target.
        Returns:
        new platform target.
      • negate

        @Contract(value="-> new",
                  pure=true)
        @NotNull
        default @NotNull PlatformTarget negate()
        Returns a new platform target that negates the result of this target.
        Specified by:
        negate in interface Predicate<Platform>
        Returns:
        new platform target.