@Override public TileIndex unencode (String value) throws ConfigurationException { return TileIndex.fromString(value); }
String[] tileDescriptions = tileSets.getString( i ).split( "\\|" ); for ( String tileDescription : tileDescriptions ) { TileIndex index = TileIndex.fromString( tileDescription ); if ( null != index ) { indices.add( index ); Integer maxZ = query.optInt( "maxZ" ); TileIndex minTile = TileIndex.fromString( query.optString( "mintile" ) ); TileIndex maxTile = TileIndex.fromString( query.optString( "maxtile" ) );
@Test public void testTileStringification () { TileIndex t = new TileIndex(0, 1, 2, 3, 4); String ts = t.toString(); Assert.assertEquals("[1 / 3, 2 / 4, lvl 0]", ts); TileIndex t2 = TileIndex.fromString(ts); Assert.assertEquals(t, t2); t = new TileIndex(9, 45, 71, 512, 1024); ts = t.toString(); Assert.assertEquals("[45 / 512, 71 / 1024, lvl 9]", ts); t2 = TileIndex.fromString(ts); Assert.assertEquals(t, t2); }