@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; SQLDataTypeImpl dataType = (SQLDataTypeImpl) o; if (name != null ? !name.equals(dataType.name) : dataType.name != null) return false; if (arguments != null ? !arguments.equals(dataType.arguments) : dataType.arguments != null) return false; return withTimeZone != null ? withTimeZone.equals(dataType.withTimeZone) : dataType.withTimeZone == null; }
@Override public boolean process(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException { if (Boolean.TRUE.equals(request.getAttribute(BasicHeaderApiTokenAuthenticator.class.getName()))) { chain.doFilter(request, response); return true; } return false; } }
private static boolean hasMetaAnnotationTypes( AnnotatedElement element, @Nullable Class<? extends Annotation> annotationType, @Nullable String annotationName) { return Boolean.TRUE.equals( searchWithGetSemantics(element, annotationType, annotationName, new SimpleAnnotationProcessor<Boolean>() { @Override @Nullable public Boolean process(@Nullable AnnotatedElement annotatedElement, Annotation annotation, int metaDepth) { return (metaDepth > 0 ? Boolean.TRUE : CONTINUE); } })); }
protected ScriptEngine getEngine() { if (Boolean.FALSE.equals(this.sharedEngine)) { Assert.state(this.engineName != null, "No engine name specified"); return createEngineFromName(this.engineName); } else { Assert.state(this.engine != null, "No shared engine available"); return this.engine; } }
public boolean condition(String conditionExpression, AnnotatedElementKey methodKey, EvaluationContext evalContext) { return (Boolean.TRUE.equals(getExpression(this.conditionCache, methodKey, conditionExpression).getValue( evalContext, Boolean.class))); }
public boolean unless(String unlessExpression, AnnotatedElementKey methodKey, EvaluationContext evalContext) { return (Boolean.TRUE.equals(getExpression(this.unlessCache, methodKey, unlessExpression).getValue( evalContext, Boolean.class))); }
/** * Clear property skipping for this element. * @since 3.2.13 */ protected void clearPropertySkipping(@Nullable PropertyValues pvs) { if (pvs == null) { return; } synchronized (pvs) { if (Boolean.FALSE.equals(this.skip) && this.pd != null && pvs instanceof MutablePropertyValues) { ((MutablePropertyValues) pvs).clearProcessedProperty(this.pd.getName()); } } }
private boolean alreadyPopulatedRequestContextHolder(TestContext testContext) { return Boolean.TRUE.equals(testContext.getAttribute(POPULATED_REQUEST_CONTEXT_HOLDER_ATTRIBUTE)); }
/** * Determine if an annotation of the specified {@code annotationName} is * <em>present</em> on the supplied {@link AnnotatedElement} or within the * annotation hierarchy <em>above</em> the specified element. * <p>If this method returns {@code true}, then {@link #getMergedAnnotationAttributes} * will return a non-null value. * <p>This method follows <em>get semantics</em> as described in the * {@linkplain AnnotatedElementUtils class-level javadoc}. * @param element the annotated element * @param annotationName the fully qualified class name of the annotation type to find * @return {@code true} if a matching annotation is present */ public static boolean isAnnotated(AnnotatedElement element, String annotationName) { return Boolean.TRUE.equals(searchWithGetSemantics(element, null, annotationName, alwaysTrueAnnotationProcessor)); }
@Override public final void serializeWithType(Object value, JsonGenerator g, SerializerProvider provider, TypeSerializer typeSer) throws IOException { // 27-Mar-2017, tatu: Actually here we CAN NOT serialize as number without type, // since with natural types that would map to number, not boolean. So choice // comes to between either add type id, or serialize as boolean. Choose // latter at this point g.writeBoolean(Boolean.TRUE.equals(value)); }
/** * If the {@link #REINJECT_DEPENDENCIES_ATTRIBUTE} in the supplied * {@link TestContext test context} has a value of {@link Boolean#TRUE}, * this method will have the same effect as * {@link #prepareTestInstance(TestContext) prepareTestInstance()}; * otherwise, this method will have no effect. */ @Override public void beforeTestMethod(TestContext testContext) throws Exception { if (Boolean.TRUE.equals(testContext.getAttribute(REINJECT_DEPENDENCIES_ATTRIBUTE))) { if (logger.isDebugEnabled()) { logger.debug("Reinjecting dependencies for test context [" + testContext + "]."); } injectDependencies(testContext); } }
/** * Determine whether the given bean should be proxied with its target * class rather than its interfaces. Checks the * {@link #PRESERVE_TARGET_CLASS_ATTRIBUTE "preserveTargetClass" attribute} * of the corresponding bean definition. * @param beanFactory the containing ConfigurableListableBeanFactory * @param beanName the name of the bean * @return whether the given bean should be proxied with its target class */ public static boolean shouldProxyTargetClass( ConfigurableListableBeanFactory beanFactory, @Nullable String beanName) { if (beanName != null && beanFactory.containsBeanDefinition(beanName)) { BeanDefinition bd = beanFactory.getBeanDefinition(beanName); return Boolean.TRUE.equals(bd.getAttribute(PRESERVE_TARGET_CLASS_ATTRIBUTE)); } return false; }
/** * Whether to show the upgrade wizard */ public boolean isShowUpgradeWizard() { HttpSession session = Stapler.getCurrentRequest().getSession(false); if(session != null) { return Boolean.TRUE.equals(session.getAttribute(SHOW_UPGRADE_WIZARD_FLAG)); } return false; } /**
/** * Create a JMS Connection via this template's ConnectionFactory. * @return the new JMS Connection * @throws javax.jms.JMSException if thrown by JMS API methods */ protected Connection doCreateConnection() throws JMSException { ConnectionFactory cf = getTargetConnectionFactory(); if (Boolean.FALSE.equals(this.pubSubMode) && cf instanceof QueueConnectionFactory) { return ((QueueConnectionFactory) cf).createQueueConnection(); } else if (Boolean.TRUE.equals(this.pubSubMode) && cf instanceof TopicConnectionFactory) { return ((TopicConnectionFactory) cf).createTopicConnection(); } else { return obtainTargetConnectionFactory().createConnection(); } }
private boolean isActivated(TestContext testContext) { return (Boolean.TRUE.equals(testContext.getAttribute(ACTIVATE_LISTENER)) || AnnotatedElementUtils.hasAnnotation(testContext.getTestClass(), WebAppConfiguration.class)); }
/** * Specify if the condition defined by the specified expression matches. */ public boolean condition(String conditionExpression, ApplicationEvent event, Method targetMethod, AnnotatedElementKey methodKey, Object[] args, @Nullable BeanFactory beanFactory) { EventExpressionRootObject root = new EventExpressionRootObject(event, args); MethodBasedEvaluationContext evaluationContext = new MethodBasedEvaluationContext( root, targetMethod, args, getParameterNameDiscoverer()); if (beanFactory != null) { evaluationContext.setBeanResolver(new BeanFactoryResolver(beanFactory)); } return (Boolean.TRUE.equals(getExpression(this.conditionCache, methodKey, conditionExpression).getValue( evaluationContext, Boolean.class))); }
public boolean compile() throws Exception { String fullName = clsNode.getFullName(); String code = clsNode.getCode().toString(); JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); fileManager = new ClassFileManager(compiler.getStandardFileManager(null, null, null)); List<JavaFileObject> jFiles = new ArrayList<>(1); jFiles.add(new CharSequenceJavaFileObject(fullName, code)); CompilationTask compilerTask = compiler.getTask(null, fileManager, null, null, null, jFiles); return Boolean.TRUE.equals(compilerTask.call()); }
private void closeOnRead(ChannelPipeline pipeline) { if (isOpen()) { if (Boolean.TRUE.equals(config().getOption(ChannelOption.ALLOW_HALF_CLOSURE))) { shutdownInput(); pipeline.fireUserEventTriggered(ChannelInputShutdownEvent.INSTANCE); } else { unsafe().close(unsafe().voidPromise()); } pipeline.fireUserEventTriggered(ChannelInputShutdownReadComplete.INSTANCE); } }
@Test public void setBooleanProperty() { BooleanTestBean target = new BooleanTestBean(); AbstractPropertyAccessor accessor = createAccessor(target); accessor.setPropertyValue("bool2", "true"); assertTrue("Correct bool2 value", Boolean.TRUE.equals(accessor.getPropertyValue("bool2"))); assertTrue("Correct bool2 value", target.getBool2()); accessor.setPropertyValue("bool2", "false"); assertTrue("Correct bool2 value", Boolean.FALSE.equals(accessor.getPropertyValue("bool2"))); assertTrue("Correct bool2 value", !target.getBool2()); }