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

com.oracle.coherence.io.json.genson.Modifier Maven / Gradle / Ivy

/*
 * Copyright (c) 2020, Oracle and/or its affiliates.
 *
 * Copyright 2011-2014 Genson - Cepoi Eugen
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use
 * this file except in compliance with the License.
 *
 * 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 com.oracle.coherence.io.json.genson;


import java.util.Objects;

/**
 * @author Aleks Seovic  2018.06.03
*/
@FunctionalInterface
public interface Modifier {
    T apply(T obj);

   default Modifier andThen(Modifier after) {
        Objects.requireNonNull(after);
        return t -> after.apply(apply(t));
    }

    static  Modifier identity() {
        return t -> t;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy