Example usage for java.util Map toString

List of usage examples for java.util Map toString

Introduction

In this page you can find the example usage for java.util Map toString.

Prototype

public String toString() 

Source Link

Document

Returns a string representation of the object.

Usage

From source file:com.secbro.qark.exportedcomponent.exportedactivity.IntentSenderActivity.java

private void showResultFromExploit(Map resultMap) {
    if (mResultText != null) {
        mResultText.setText(resultMap.toString());
    }
}

From source file:com.gs.obevo.dbmetadata.impl.dialects.OracleMetadataDialect.java

@Override
public ImmutableSet<DaDirectory> getDirectoriesOptional(Connection conn) throws SQLException {
    final String sql = "SELECT DIRECTORY_NAME, DIRECTORY_PATH FROM DBA_DIRECTORIES";
    LOG.debug("Executing directory metadata query SQL: {}", sql);

    ImmutableList<Map<String, Object>> maps = ListAdapter.adapt(jdbc.query(conn, sql, new MapListHandler()))
            .toImmutable();/*from  ww w  .  j  a v  a 2 s.  c  o m*/

    if (LOG.isDebugEnabled()) {
        LOG.debug("Results:");
        for (Map<String, Object> map : maps) {
            LOG.debug("ROW: {}", map.toString());
        }
    }

    return maps.collect(new Function<Map<String, Object>, DaDirectory>() {
        @Override
        public DaDirectory valueOf(Map<String, Object> map) {
            return (DaDirectory) new DaDirectoryImpl((String) map.get("DIRECTORY_NAME"),
                    (String) map.get("DIRECTORY_PATH"));
        }
    }).toSet().toImmutable();
}

From source file:consumer.kafka.ZkState.java

public void writeJSON(String path, Map<Object, Object> data) {
    LOG.info("Writing " + path + " the data " + data.toString());
    writeBytes(path, JSONValue.toJSONString(data).getBytes(Charset.forName("UTF-8")));
}

From source file:com.gs.obevo.dbmetadata.impl.dialects.OracleMetadataDialect.java

@Override
public ImmutableCollection<DaPackage> searchPackages(final DaSchema schema, String procedureName,
        Connection conn) throws SQLException {
    String procedureClause = procedureName == null ? "" : " AND OBJECT_NAME = '" + procedureName + "'";
    final String sql = "SELECT OBJECT_NAME, OBJECT_TYPE FROM ALL_OBJECTS\n"
            + "WHERE OBJECT_TYPE IN ('PACKAGE')\n" + "AND OWNER = '" + schema.getName() + "'\n"
            + procedureClause;/*from ww w .j  a v a 2 s . co  m*/
    LOG.debug("Executing package metadata query SQL: {}", sql);

    ImmutableList<Map<String, Object>> maps = ListAdapter.adapt(jdbc.query(conn, sql, new MapListHandler()))
            .toImmutable();

    if (LOG.isDebugEnabled()) {
        LOG.debug("Results:");
        for (Map<String, Object> map : maps) {
            LOG.debug("ROW: {}", map.toString());
        }
    }

    return maps.collect(new Function<Map<String, Object>, DaPackage>() {
        @Override
        public DaPackage valueOf(Map<String, Object> map) {
            return new DaPackagePojoImpl((String) map.get("OBJECT_NAME"), schema);
        }
    });
}

From source file:com.unknown.pkg.FakeController.java

@RequestMapping(value = "/access_token", method = RequestMethod.POST, params = {
        "realm=whatever" }, produces = {
                APPLICATION_JSON_VALUE }, consumes = { APPLICATION_FORM_URLENCODED_VALUE })
@ResponseBody//from   w  w  w. ja  v a2 s. c om
public Map<String, Object> fakeTheResponse(@RequestParam final Map<String, Object> request) {
    logger.warn("------- AUTHORIZATION_REQUEST INCOMING-------");
    logger.warn(request.toString());
    logger.warn("--------AUTHORIZATION_COMPLETE----------------");

    Map<String, Object> result = Maps.newHashMap();
    result.put("access_token", "123456789-987654321");
    result.put("token_type", "Bearer");
    result.put("expires_in", 5000);

    return result;
}

From source file:fcl.rest.UploadResource.java

@POST
@Consumes({ MediaType.MULTIPART_FORM_DATA })
@Path("file")
public String uploadFile(@FormDataValues MultivaluedMap<String, String> formFields) {
    Map<String, String> data = new HashMap<>();
    formFields.forEach((key, values) -> data.put(key, values.stream().collect(Collectors.joining(","))));
    return data.toString();
}

From source file:com.gs.obevo.dbmetadata.impl.dialects.Db2MetadataDialect.java

@Override
public ImmutableCollection<DaRoutine> searchExtraRoutines(final DaSchema schema, String procedureName,
        Connection conn) throws SQLException {
    QueryRunner query = new QueryRunner(); // using queryRunner so that we can reuse the connection

    String procedureClause = procedureName == null ? "" : " AND R.ROUTINENAME = '" + procedureName + "'";
    final String sql = "SELECT ROUTINENAME, SPECIFICNAME, TEXT FROM SYSCAT.ROUTINES R WHERE R.ROUTINETYPE = 'F'\n"
            + "AND R.ROUTINESCHEMA = '" + schema.getName() + "'\n" + procedureClause;
    LOG.debug("Executing function metadata query SQL: {}", sql);

    ImmutableList<Map<String, Object>> maps = ListAdapter.adapt(query.query(conn, sql, new MapListHandler()))
            .toImmutable();/*from   ww w .  ja v a 2s .  c  om*/

    if (LOG.isDebugEnabled()) {
        LOG.debug("Results:");
        for (Map<String, Object> map : maps) {
            LOG.debug("ROW: {}", map.toString());
        }
    }

    return maps.collect(new Function<Map<String, Object>, DaRoutine>() {
        @Override
        public DaRoutine valueOf(Map<String, Object> map) {
            return new DaRoutinePojoImpl((String) map.get("ROUTINENAME"), schema, DaRoutineType.function,
                    (String) map.get("SPECIFICNAME"), clobToString((Clob) map.get("TEXT")));
        }
    });
}

From source file:org.godotengine.godot.MessagingService.java

@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
    Utils.d("Message From: " + remoteMessage.getFrom());
    Utils.d("Message From: " + remoteMessage.toString());

    // Check if message contains a data payload.
    if (remoteMessage.getData().size() > 0) {
        Map<String, String> data = remoteMessage.getData();

        Utils.d("Message data payload: " + data.toString());

        KeyValueStorage.set_context(this);
        handleData(data);/* www .ja v a  2 s .c  om*/
    }

    // Check if message contains a notification payload.
    if (remoteMessage.getNotification() != null) {
        Utils.d("Notification Body: " + remoteMessage.getNotification().getBody());

        sendNotification(remoteMessage.getNotification().getBody(), this);
    }
}

From source file:com.verisign.storm.metrics.reporters.kafka.BaseKafkaReporter.java

@Override
public void prepare(Map<String, Object> conf) {
    LOG.info(conf.toString());

    if (conf.containsKey(KAFKA_TOPIC_NAME_FIELD)) {
        kafkaTopicName = (String) conf.get(KAFKA_TOPIC_NAME_FIELD);
        conf.remove(KAFKA_TOPIC_NAME_FIELD);
    } else {//w ww . j  a  va2s. c  o  m
        throw new IllegalArgumentException("Field " + KAFKA_TOPIC_NAME_FIELD + " required.");
    }

    if (conf.containsKey(KAFKA_BROKER_LIST_FIELD)) {
        kafkaBrokerList = (String) conf.get(KAFKA_BROKER_LIST_FIELD);
        conf.remove(KAFKA_BROKER_LIST_FIELD);
        conf.put(KAFKA_PRODUCER_BOOTSTRAP_SERVERS_FIELD, kafkaBrokerList);
    } else if (conf.containsKey(KAFKA_PRODUCER_BOOTSTRAP_SERVERS_FIELD)) {
        kafkaBrokerList = (String) conf.get(KAFKA_PRODUCER_BOOTSTRAP_SERVERS_FIELD);
    } else {
        throw new IllegalArgumentException("Field " + KAFKA_BROKER_LIST_FIELD + " required.");
    }

    Properties producerProps = new Properties();
    for (Entry<String, Object> entry : conf.entrySet()) {
        if (entry.getValue() != null) {
            producerProps.setProperty(entry.getKey(), entry.getValue().toString());
        }
    }

    kafkaProducer = configureKafkaProducer(producerProps);
    buffer = new LinkedList<GraphingMetrics>();
    failures = 0;
}

From source file:com.aalto.controllers.ProjectController.java

@RequestMapping(value = "/newProject", method = RequestMethod.POST)
public Project createProject(@RequestParam Map<String, String> reqParams) {
    logger.log(Level.INFO, "log: ProjectController newProject!!");
    logger.log(Level.INFO, reqParams.toString());
    String name = reqParams.get("name");

    Project newProject = new Project(name);

    Long pid = this.projectRepo.save(newProject);
    Project savedProject = this.projectRepo.find(pid);

    return savedProject;
}