tl  tr
  Home | Tutorials | Articles | Videos | Products | Tools | Search
Interviews | Open Source | Tag Cloud | Follow Us | Bookmark | Contact   
 Tools and Libs > Google Guava > Collections > Map from Properties

Map from Properties 

Google Guava is a java library with lot of utilities and reusable components. This requires the library guava-10.0.jar to be in classpath. The following example shows using Maps.fromProperties() API. It creates an immutable map instance from the given properties object.

File Name  :  
Author  :  Sudhakar KV
Email  :  [email protected]
package com.bethecoder.tutorials.guava.collection_tests;

import java.util.Map;


public class MapFromPropsTest {

   @param args
  public static void main(String[] args) {
    Map<String, String> sysProps = Maps.fromProperties(System.getProperties())

It gives the following output,
{ SE Runtime Environment, 
sun.boot.library.path=C:\Program Files\Java\jdk1.6.0_10\jre\bin, 

.... XP, 


bl  br