Package java.util

Examples of java.util.Map


  @Test
  public void testNullReverse() {
    A source = new A();
    source.setB(null);
    Map dest = mapper.map(source, HashMap.class, NULL);
    assertNotNull(dest);
    assertTrue(dest.containsKey("key"));
    assertNull(dest.get("key"));
  }
View Full Code Here


  @Test
  public void testNullReverse_NoNullMApping() {
    A source = new A();
    source.setB(null);
    Map dest = mapper.map(source, HashMap.class, NOT_NULL);
    assertNotNull(dest);
    assertFalse(dest.containsKey("key"));
  }
View Full Code Here

    private static final String JBOSS_LOGIN_MODULE_CLASS_NAME = "org.jboss.security.ClientLoginModule";
    private static final String MULTI_THREADED_OPTION = "multi-threaded";

    public AppConfigurationEntry[] getAppConfigurationEntry(String name) {
        if (JBOSS_ENTRY_NAME.equals(name)) {
            Map options = new HashMap(1);
            options.put(MULTI_THREADED_OPTION, Boolean.TRUE.toString());
            AppConfigurationEntry appConfigurationEntry = new AppConfigurationEntry(JBOSS_LOGIN_MODULE_CLASS_NAME, AppConfigurationEntry.LoginModuleControlFlag.REQUIRED, options);
            return new AppConfigurationEntry[] {appConfigurationEntry};
        }
        throw new IllegalArgumentException("Unknown entry name: " + name);
    }
View Full Code Here

     
      int[] values = StringUtil.valueOf("1,2,3,4,5", new int[0].getClass()); //$NON-NLS-1$
      assertEquals(5, values.length);
      assertEquals(5, values[4]);
     
      Map m = StringUtil.valueOf("foo=bar,x=,y=z", Map.class); //$NON-NLS-1$
      assertEquals(3, m.size());
      assertEquals(m.get("foo"), "bar"); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(m.get("x"), ""); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(Test.HELLO, StringUtil.valueOf("HELLO", Test.class)); //$NON-NLS-1$
     
      assertEquals(new URL("http://teiid.org"), StringUtil.valueOf("http://teiid.org", URL.class)); //$NON-NLS-1$ //$NON-NLS-2$
    }
View Full Code Here

    try {
      init();
      GetDataMapCommand command = commandsFactory.buildGetDataMapCommand(name);
      List resps = callRemote(command);
     
      Map result = Collections.EMPTY_MAP;
      for (Object o:resps) {
        if (o != null && !(o instanceof Exception)) {
          List clusteredGetResp = (List) o;
          if ((Boolean)clusteredGetResp.get(0)) {
            Map resp = (Map)clusteredGetResp.get(1);
            if (!resp.isEmpty()) {
              result = resp;
            }
          }
        }
      }     
View Full Code Here

    public Object getValue(int columnIndex, Integer metadataPropertyKey) throws SQLException {
        if(columnIndex < 0 || columnIndex >= metadata.length) {
            throw new SQLException(JDBCPlugin.Util.getString("StaticMetadataProvider.Invalid_column", columnIndex)); //$NON-NLS-1$
        }
       
        Map column = this.metadata[columnIndex];
        return column.get(metadataPropertyKey);
    }
View Full Code Here

            if (resp) {
              numValidResponses++;   
            }
          }
          else if (command instanceof GetDataMapCommand) {
            Map resp = (Map)response.get(1);
            if (!resp.isEmpty()) {
              numValidResponses++;
            }
          }
        }
      }
View Full Code Here

      Class cls = null;
      try {
        cls = object.getClass();
        Iterator methodIter = fieldNameList.iterator();
        Map reportValueMap = new HashMap<String, String>();
        while (methodIter.hasNext()) {
          String fieldName = (String) methodIter.next();
          String methodName = fieldName;
          Method meth = cls.getMethod(methodName, (Class[]) null);
          Object retObj = meth.invoke(object, (Object[]) null);
          reportValueMap.put(fieldName, retObj);
        }
        reportResultList.add(reportValueMap);
      } catch (Throwable e) {
        System.err.println(e);
      }
View Full Code Here

    while (objectIter.hasNext()) {
      ArrayList<Object> columnValues = (ArrayList<Object>) objectIter.next();

      try {
        Iterator fieldIter = fieldNameList.iterator();
        Map reportValueMap = new HashMap<String, Object>();
        // Iterate through columns with a row
        for (Object columnValue : columnValues) {
          String fieldName = (String) fieldIter.next();
          reportValueMap.put(fieldName, columnValue);
        }
        reportResultList.add(reportValueMap);
      } catch (Throwable e) {
        System.err.println(e);
      }
View Full Code Here

        StringBuffer sb = new StringBuffer();
        sb.append("\nDate: " + DateFormat.getDateInstance().format(new Date()));//$NON-NLS-1$
        sb.append( LINE_SEPARATOR );       
       
        Map pathResults = new HashMap();
        List reversetList = new ArrayList();
        String separator = System.getProperty( "path.separator"  ); //$NON-NLS-1$

        StringTokenizer path = new StringTokenizer( classPath, separator );

        while(path.hasMoreTokens()){
            String pathElement = path.nextToken();
            File pathFile = new File( pathElement );
            if (pathFile.exists()) {
//                        if (resourceExistInClassPath(pathElement)) {
                pathResults.put(pathElement, Boolean.TRUE);
                   
            } else {
                pathResults.put(pathElement, Boolean.FALSE);
            }
            reversetList.add(pathElement);
        }      
        sb.append("Classpath Information" ); //$NON-NLS-1$
        sb.append( LINE_SEPARATOR );
        sb.append("CLASSPATH: "); //$NON-NLS-1$
        sb.append(classPath);
        sb.append( LINE_SEPARATOR );
        sb.append( LINE_SEPARATOR );
       
        Iterator iter = reversetList.iterator();
        sb.append("---- Classpath Entries ----"); //$NON-NLS-1$
         sb.append( LINE_SEPARATOR );      
        while ( iter.hasNext() ) {
            String epath = (String) iter.next();
            Boolean doesExist = (Boolean) pathResults.get(epath);
            sb.append(epath);
            if (!doesExist.booleanValue()) {
                sb.append(" (MISSING)");//$NON-NLS-1$
            }
            sb.append( LINE_SEPARATOR );
View Full Code Here

TOP

Related Classes of java.util.Map

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.