
commons.box.app.MetaBeanConfig Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of commons-box-app Show documentation
Show all versions of commons-box-app Show documentation
Common utils for BOX projects.
The newest version!
package commons.box.app;
import commons.box.app.bean.MetaAccess;
import commons.box.app.bean.MetaAccessProperty;
import commons.box.util.Collects;
import commons.box.util.MBs;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.io.Serializable;
import java.util.*;
/**
*
*/
public interface MetaBeanConfig extends MetaAccess, MetaLabel, HasKey, DataName, DataLabel, DataObject, Cloneable {
/** 默认实现 name=key */
@Nonnull
@Override
default String name() {
return this.key();
}
/**
* 创建新实例,对象内部属性值根据 props 生成且属性值为均空(默认值)
*
* @return
*/
@Nonnull
public MetaBean inst(@Nullable Map map);
/**
* 获取实例
*
* @param maps
* @return
*/
@Nonnull
default MetaBean[] insts(@Nullable Map[] maps) {
if (Collects.isEmpty(maps)) return MBs.EMPTY;
MetaBean[] mbs = new MetaBean[maps.length];
for (int i = 0; i < maps.length; i++) mbs[i] = this.inst(maps[i]);
return mbs;
}
/**
* 获取实例
*
* @param maps
* @return
*/
@Nonnull
default List insts(@Nullable Collection
© 2015 - 2025 Weber Informatics LLC | Privacy Policy