congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
Beans.toMap
Code IndexAdd Tabnine to your IDE (free)

How to use
toMap
method
in
leap.lang.Beans

Best Java code snippets using leap.lang.Beans.toMap (Showing top 10 results out of 315)

origin: org.leapframework/leap-orm

  @Override
  public Map<String, Object> toMap() {
    Map<String,Object> props = Beans.toMap(raw);
    if(null != map) {
      props.putAll(map);
    }
    return props;
  }
}
origin: org.leapframework/jmms-modules-redis

public Map<String, String> hencode(Object o) {
  Map<String, Object> map = Beans.toMap(o);
  Map<String, String> hash = new LinkedHashMap<>(map.size());
  map.forEach((k,v) -> {
    hash.put(k, encode(v));
  });
  return hash;
}
origin: org.leapframework/leap-orm

@SuppressWarnings({ "unchecked", "rawtypes" })
public Map<String, Object> toMap(Object object) throws InvalidParametersException {
  if(null == object){
    throw new InvalidParameterException("Cannot convert null to map");
  }
  if(object instanceof Map){
    return ((Map)object);
  }else if(object instanceof Params){
    return ((Params)object).map();
  }
  
  if(Beans.isSimpleProperty(object.getClass())){
    throw new InvalidParameterException("Cannot convert value of simple type '" + object.getClass().getName() + "' to map");
  }
  
  return Beans.toMap(object);
}
origin: org.leapframework/jmms-core

public int update(Object record, Object id) {
  if(null == id) {
    return dao.update(em, record);
  }else {
    return dao.update(em, id, Beans.toMap(record));
  }
}
origin: org.leapframework/leap-orm

@Override
public int executeNamedUpdate(String sqlKey, Object bean) {
  return ensureGetSqlCommand(sqlKey).executeUpdate(simpleSqlContext, Beans.toMap(bean));
}
origin: org.leapframework/leap-orm

public static Object[] getIdArgs(EntityMapping em, Object id) {
  if(id instanceof Object[]) {
    return (Object[])id;
  }
  if(id instanceof Collection) {
    return ((Collection)id).toArray();
  }
  if(em.getKeyColumnNames().length > 1) {
    Map map;
    if(id instanceof Map) {
      map = (Map)id;
    }else {
      map = Beans.toMap(id);
    }
    List<Object> args = new ArrayList<>();
    for(String name : em.getKeyFieldNames()) {
      args.add(map.get(name));
    }
    return args.toArray();
  }else {
    return new Object[]{id};
  }
}

origin: org.leapframework/leap-webapi

public static String getIdPath(EntityMapping em, Object id) {
  if(em.getKeyFieldNames().length == 1) {
    return "/" + id;
  }else if(id instanceof Map){
    return getIdPath(em, (Map)id);
  }else {
    return getIdPath(em, Beans.toMap(id));
  }
}
origin: org.leapframework/jmms-plugins-swagger-doc

@Override
protected int processParameter(Object param, Options options, int index, int size, boolean isOmitMeta) {
  if(param instanceof Map){
    return processMap((Map)param, options, index, size, isOmitMeta);
  }
  try {
    return super.processParameter(param, options, index, size, isOmitMeta);
  }catch (MustacheException e) {
    return processMap(Beans.toMap(param), options, index, size, isOmitMeta);
  }
}
origin: org.leapframework/jmms-core

@Override
protected boolean doValidate(Validation validation, String name, Object value, Out<Object> out) {
  boolean isMap = value instanceof Map;
  Map map = isMap ? (Map)value : Beans.toMap(value);
origin: org.leapframework/leap-webapi

  properties = (Map)request;
}else{
  properties = Beans.toMap(request);
leap.langBeanstoMap

Popular methods of Beans

  • copyProperties
  • isSimpleProperty
    Check if the given type represents a "simple" property: a primitive, a String or other CharSequence,
  • getNestableProperty
  • getArrayProperty
  • getNestedMapProperty
  • getNestedProperty
  • getProperty
  • setArrayProperty
  • setNestedMapProperty
  • setNestedProperty
  • setPropertiesNestable
  • setPropertiesNestableInternal
  • setPropertiesNestable,
  • setPropertiesNestableInternal,
  • setProperty,
  • tryIncreaseSize

Popular in Java

  • Parsing JSON documents to java classes using gson
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getSharedPreferences (Context)
  • getExternalFilesDir (Context)
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • Reference (javax.naming)
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • 21 Best IntelliJ Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now