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

com.arextest.storage.service.config.ViewHandler Maven / Gradle / Ivy

There is a newer version: 2.0.2
Show newest version
package com.arextest.storage.service.config;

import java.util.List;

/**
 * @author jmo
 * @since 2022/1/22
 */
public interface ViewHandler {

  /**
   * show all exists items
   *
   * @return list all
   */
  default List useResultAsList() {
    return null;
  }

  /**
   * after configured,we apply the result as a single value return.
   *
   * @param appId the value
   * @return config result
   */
  default T useResult(String appId) {
    List useResultList = this.useResultAsList(appId);
    if (useResultList != null && !useResultList.isEmpty()) {
      return useResultList.get(0);
    }
    return null;
  }

  /**
   * after configured,we apply the result as list return.
   *
   * @param appId the appId not null
   * @return config result
   */
  List useResultAsList(String appId);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy