Tabnine Logo
BooleanUtils.toStringYesNo
Code IndexAdd Tabnine to your IDE (free)

How to use
toStringYesNo
method
in
org.apache.commons.lang3.BooleanUtils

Best Java code snippets using org.apache.commons.lang3.BooleanUtils.toStringYesNo (Showing top 10 results out of 315)

origin: org.apache.commons/commons-lang3

@Test
public void test_toStringYesNo_Boolean() {
  assertNull(BooleanUtils.toStringYesNo(null));
  assertEquals("yes", BooleanUtils.toStringYesNo(Boolean.TRUE));
  assertEquals("no", BooleanUtils.toStringYesNo(Boolean.FALSE));
}
origin: org.apache.commons/commons-lang3

@Test
public void test_toStringYesNo_boolean() {
  assertEquals("yes", BooleanUtils.toStringYesNo(true));
  assertEquals("no", BooleanUtils.toStringYesNo(false));
}
origin: org.apereo.cas/cas-server-support-reports

  /**
   * Sso status response entity.
   *
   * @param request the request
   * @return the response entity
   */
  @GetMapping(produces = MediaType.APPLICATION_JSON_VALUE)
  public ResponseEntity<String> ssoStatus(final HttpServletRequest request) {
    val tgtId = this.ticketGrantingTicketCookieGenerator.retrieveCookieValue(request);
    if (StringUtils.isBlank(tgtId)) {
      return ResponseEntity.ok(BooleanUtils.toStringYesNo(false));
    }
    val auth = this.ticketRegistrySupport.getAuthenticationFrom(tgtId);
    return ResponseEntity.ok(BooleanUtils.toStringYesNo(auth != null));
  }
}
origin: org.apereo.cas/cas-server-core-validation-api

@Override
public boolean isSatisfiedBy(final Assertion assertion, final HttpServletRequest request) {
  LOGGER.trace("Is validation specification set to enforce [{}] protocol behavior? [{}]. Is assertion issued from a new login? [{}]",
    CasProtocolConstants.PARAMETER_RENEW, BooleanUtils.toStringYesNo(this.renew),
    BooleanUtils.toStringYesNo(assertion.isFromNewLogin()));
  var satisfied = isSatisfiedByInternal(assertion);
  if (!satisfied) {
    LOGGER.warn("[{}] is not internally satisfied by the produced assertion", getClass().getSimpleName());
    return false;
  }
  satisfied = !this.renew || assertion.isFromNewLogin();
  if (!satisfied) {
    LOGGER.warn("[{}] is to enforce the [{}] CAS protocol behavior, yet the assertion is not issued from a new login", getClass().getSimpleName(),
      CasProtocolConstants.PARAMETER_RENEW);
    return false;
  }
  LOGGER.trace("Validation specification is satisfied by the produced assertion");
  return true;
}
origin: org.apereo.cas/cas-server-support-saml-idp-core

  @Override
  protected Map<String, Object> getAttributesForSamlRegisteredService(final Map<String, Object> attributes,
                                    final SamlRegisteredService service,
                                    final ApplicationContext applicationContext,
                                    final SamlRegisteredServiceCachingMetadataResolver resolver,
                                    final SamlRegisteredServiceServiceProviderMetadataFacade facade,
                                    final EntityDescriptor entityDescriptor) {
    val pattern = RegexUtils.createPattern(this.entityIds);
    val entityID = entityDescriptor.getEntityID();
    val matcher = pattern.matcher(entityID);
    val matched = fullMatch ? matcher.matches() : matcher.find();
    LOGGER.debug("Pattern [{}] matched against [{}]? [{}]", pattern.pattern(), entityID, BooleanUtils.toStringYesNo(matched));
    if (matched) {
      return authorizeReleaseOfAllowedAttributes(attributes);
    }
    return new HashMap<>(0);
  }
}
origin: org.apereo.cas/cas-server-support-cookie

private boolean isRememberMeAuthentication(final RequestContext requestContext) {
  final HttpServletRequest request = WebUtils.getHttpServletRequestFromExternalWebflowContext(requestContext);
  final String value = request.getParameter(RememberMeCredential.REQUEST_PARAMETER_REMEMBER_ME);
  LOGGER.debug("Locating request parameter [{}] with value [{}]", RememberMeCredential.REQUEST_PARAMETER_REMEMBER_ME, value);
  boolean isRememberMe = StringUtils.isNotBlank(value) && WebUtils.isRememberMeAuthenticationEnabled(requestContext);
  if (!isRememberMe) {
    LOGGER.debug("Request does not indicate a remember-me authentication event. Locating authentication object from the request context...");
    final Authentication auth = WebUtils.getAuthentication(requestContext);
    if (auth != null) {
      final Map<String, Object> attributes = auth.getAttributes();
      LOGGER.debug("Located authentication attributes [{}]", attributes);
      if (attributes.containsKey(RememberMeCredential.AUTHENTICATION_ATTRIBUTE_REMEMBER_ME)) {
        final Object rememberMeValue = attributes.getOrDefault(RememberMeCredential.AUTHENTICATION_ATTRIBUTE_REMEMBER_ME, false);
        LOGGER.debug("Located remember-me authentication attribute [{}]", rememberMeValue);
        isRememberMe = CollectionUtils.wrapSet(rememberMeValue).contains(true);
      }
    }
  }
  LOGGER.debug("Is this request from a remember-me authentication event? [{}]", BooleanUtils.toStringYesNo(isRememberMe));
  return isRememberMe;
}
origin: org.apereo.cas/cas-server-core-util-api

  StringUtils.capitalize(BooleanUtils.toStringYesNo(latestSem.isStable())));
info.put("Update Availability", updateString);
origin: com.github.fosin/cdp-core

formatter.format("JVM Maximum Memory: %s%n", FileUtils.byteCountToDisplaySize(runtime.maxMemory()));
formatter.format("JVM Total Memory: %s%n", FileUtils.byteCountToDisplaySize(runtime.totalMemory()));
formatter.format("JCE Installed: %s%n", StringUtils.capitalize(BooleanUtils.toStringYesNo(isJceInstalled())));
formatter.format("%s%n", LINE_SEPARATOR);
origin: org.apereo.cas/cas-server-core-util-api

info.put("JVM Total Memory", FileUtils.byteCountToDisplaySize(runtime.totalMemory()));
info.put("JCE Installed", StringUtils.capitalize(BooleanUtils.toStringYesNo(EncodingUtils.isJceInstalled())));
origin: org.apereo.cas/cas-server-support-saml-idp-metadata

  @Override
  protected void doHealthCheck(final Health.Builder builder) {
    val samlServices = servicesManager.findServiceBy(registeredService -> registeredService instanceof SamlRegisteredService);
    val availableResolvers = this.metadataResolutionPlan.getRegisteredMetadataResolvers();
    LOGGER.debug("There are [{}] metadata resolver(s) available in the chain", availableResolvers.size());

    builder.up();

    samlServices.stream()
      .map(SamlRegisteredService.class::cast)
      .forEach(service -> availableResolvers
        .stream()
        .filter(Objects::nonNull)
        .forEach(r -> {
          LOGGER.debug("Evaluating whether metadata resolver [{}] is available for service [{}]", r.getName(), service.getName());
          val available = r.isAvailable(service);
          val map = new HashMap<String, Object>();
          map.put("name", service.getName());
          map.put("id", service.getId());
          map.put("metadataLocation", service.getMetadataLocation());
          map.put("serviceId", service.getServiceId());
          map.put("availability", BooleanUtils.toStringYesNo(available));
          builder.withDetail(service.getName(), map);
          if (!available) {
            builder.down();
          }
        }));
  }
}
org.apache.commons.lang3BooleanUtilstoStringYesNo

Javadoc

Converts a Boolean to a String returning 'yes', 'no', or null.

 
BooleanUtils.toStringYesNo(Boolean.TRUE)  = "yes" 
BooleanUtils.toStringYesNo(Boolean.FALSE) = "no" 
BooleanUtils.toStringYesNo(null)          = null; 

Popular methods of BooleanUtils

  • toBoolean
    Converts a String to a Boolean throwing an exception if no match found. BooleanUtils.toBoolean("t
  • isTrue
    Checks if a Boolean value is true, handling null by returning false. BooleanUtils.isTrue(Boolean.
  • toBooleanObject
    Converts a String to a Boolean throwing an exception if no match. NOTE: This returns null and will
  • isFalse
    Checks if a Boolean value is false, handling null by returning false. BooleanUtils.isFalse(Boolea
  • isNotTrue
    Checks if a Boolean value is not true, handling null by returning true. BooleanUtils.isNotTrue(Bo
  • toStringTrueFalse
    Converts a boolean to a String returning 'true'or 'false'. BooleanUtils.toStringTrueFalse(true)
  • toBooleanDefaultIfNull
    Converts a Boolean to a boolean handling null. BooleanUtils.toBooleanDefaultIfNull(Boolean.TRUE,
  • toString
    Converts a boolean to a String returning one of the input Strings. BooleanUtils.toString(true, "t
  • isNotFalse
    Checks if a Boolean value is not false, handling null by returning true. BooleanUtils.isNotFalse(
  • or
    Performs an or on a set of booleans. BooleanUtils.or(true, true) = true BooleanUtils.or
  • and
    Performs an and on a set of booleans. BooleanUtils.and(true, true) = true BooleanUtils.a
  • xor
    Performs an xor on a set of booleans. BooleanUtils.xor(true, true) = false BooleanUtils.xor(fa
  • and,
  • xor,
  • toInteger,
  • compare,
  • negate,
  • toStringOnOff,
  • <init>,
  • toIntegerObject

Popular in Java

  • Reading from database using SQL prepared statement
  • scheduleAtFixedRate (ScheduledExecutorService)
  • setContentView (Activity)
  • compareTo (BigDecimal)
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • 14 Best Plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now