FINERACT-2169: Refactor client address controller;

This commit is contained in:
viktorpavlenko
2025-04-24 11:45:13 +02:00
committed by Adam Saghy
parent 99f12d6091
commit 30543fd72e
12 changed files with 208 additions and 193 deletions
@@ -0,0 +1,38 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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.apache.fineract.infrastructure.core.component;
import java.util.function.Function;
import java.util.function.Predicate;
import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
public class FetcherRule<P, R> {
private final Predicate<P> condition;
private final Function<P, R> action;
public boolean matches(P params) {
return condition.test(params);
}
public R execute(P params) {
return action.apply(params);
}
}
@@ -22,8 +22,10 @@ import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.Collection;
import lombok.Getter;
import org.apache.fineract.infrastructure.codes.data.CodeValueData;
@Getter
@SuppressWarnings("unused")
public class AddressData implements Serializable {