All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.dbflute.optional.OptionalThingConsumer Maven / Gradle / Ivy

/*
 * Copyright 2014-2020 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 */
package org.dbflute.optional;

/**
 * The consumer of optional thing.
 * 
 * opt.ifPresent(member -> {
 *     // called if value exists, not called if not present
 *     ... = member.getMemberName();
 * });
 * opt.required(member -> {
 *     // called if value exists, or exception if not present
 *     ... = member.getMemberName();
 * });
 * 
* @param The type of wrapped object in optional thing. * @author jflute * @since 1.0.5F (2014/05/10 Saturday) */ @FunctionalInterface public interface OptionalThingConsumer { /** * Accept the value in the optional object. *
     * when caller is ifPresent():
     *   called if value exists, not called if not present
     *
     * when caller is required():
     *   called if value exists, or exception if not present
     * 
* @param obj The wrapped object in the optional object. (NotNull) */ void accept(OBJ obj); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy