Package ninja.utils

Class NinjaModeHelper


  • public class NinjaModeHelper
    extends Object
    • Constructor Detail

      • NinjaModeHelper

        public NinjaModeHelper()
    • Method Detail

      • determineModeFromSystemProperties

        public static Optional<NinjaMode> determineModeFromSystemProperties()
        returns an empty Optional if no mode is set. Or the valid mode set via a System Property called "ninja.mode". E.g. under mvn you can use mvn ... -Dninja.mode=prod or so. Valid values for ninja.mode are "prod", "dev", "test".
        Returns:
        The valid mode set via a System Property called "ninja.mode" or Optional absent if we cannot get one.
      • determineModeFromSystemPropertiesOrProdIfNotSet

        public static NinjaMode determineModeFromSystemPropertiesOrProdIfNotSet()
        returns NinjaMode.dev if no mode is set. Or the valid mode set via a System Property called "ninja.mode". E.g. under mvn you can use mvn ... -Dninja.mode=prod or so. Valid values for ninja.mode are "prod", "dev", "test".
        Returns:
        The valid mode set via a System Property called "ninja.mode" or NinjaMode.dev if it is not set.