test_class.declarator: decoder = new OpenLRProtoDecoder()
test_class.original_string: OpenLRProtoDecoder decoder = new OpenLRProtoDecoder();
test_class.type: OpenLRProtoDecoder
test_class.var_name: decoder
test_class.file: proto/src/test/java/openlr/proto/OpenLRProtoDecoderTest.java
test_class.identifier: OpenLRProtoDecoderTest
test_case.body: @Test
      public void testPolygonLocationReference() throws PhysicalFormatException {
          Coordinates first = Coordinates.newBuilder()
                  .setLongitude(-122.915)
                  .setLatitude(39.045)
                  .build();
  
          Coordinates second = Coordinates.newBuilder()
                  .setLongitude(-122.914)
                  .setLatitude(39.046)
                  .build();
  
          Coordinates third = Coordinates.newBuilder()
                  .setLongitude(-122.913)
                  .setLatitude(39.047)
                  .build();
  
          PolygonLocationReference polygonLocationReference = PolygonLocationReference.newBuilder()
                  .addCoordinates(first)
                  .addCoordinates(second)
                  .addCoordinates(third)
                  .build();
  
          LocationReferenceData locationReferenceData = LocationReferenceData.newBuilder()
                  .setPolygonLocationReference(polygonLocationReference)
                  .build();
  
          LocationReference locationReference = new LocationReferenceProtoImpl("1", LocationType.POLYGON, locationReferenceData);
  
          RawLocationReference rawLocationReference = decoder.decodeData(locationReference);
  
          assertNotNull(rawLocationReference);
          assertEquals(rawLocationReference.getID(), "1");
          assertEquals(rawLocationReference.getLocationType(), LocationType.POLYGON);
          assertTrue(rawLocationReference.isValid());
      }
test_case.class_method_signature: OpenLRProtoDecoderTest.testPolygonLocationReference()
test_case.full_signature: @Test public void testPolygonLocationReference()
test_case.identifier: testPolygonLocationReference
test_case.invocations: build setLatitude setLongitude newBuilder build setLatitude setLongitude newBuilder build setLatitude setLongitude newBuilder build addCoordinates addCoordinates addCoordinates newBuilder build setPolygonLocationReference newBuilder decodeData assertNotNull assertEquals getID assertEquals getLocationType assertTrue isValid
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testPolygonLocationReference()
focal_class.declarator: locationTypeDecoderRegistry = LocationTypeDecoderRegistry.create()
focal_class.modifier: private final
focal_class.original_string: private final LocationTypeDecoderRegistry locationTypeDecoderRegistry = LocationTypeDecoderRegistry.create();
focal_class.type: LocationTypeDecoderRegistry
focal_class.var_name: locationTypeDecoderRegistry
focal_class.file: proto/src/main/java/openlr/proto/OpenLRProtoDecoder.java
focal_class.identifier: OpenLRProtoDecoder
focal_class.interfaces: implements PhysicalDecoder
focal_class.class_method_signature: OpenLRProtoDecoder.getDataClass()
focal_class.full_signature: @Override public Class<?> getDataClass()
focal_class.identifier: getDataClass
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Class<?>
focal_class.signature: Class<?> getDataClass()
focal_class.class_method_signature: OpenLRProtoDecoder.decodeData(LocationReference data)
focal_class.full_signature: @Override public RawLocationReference decodeData(LocationReference data)
focal_class.identifier: decodeData
focal_class.modifiers: @Override public
focal_class.parameters: (LocationReference data)
focal_class.return: RawLocationReference
focal_class.signature: RawLocationReference decodeData(LocationReference data)
focal_class.class_method_signature: OpenLRProtoDecoder.getDataFormatIdentifier()
focal_class.full_signature: @Override public String getDataFormatIdentifier()
focal_class.identifier: getDataFormatIdentifier
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getDataFormatIdentifier()
focal_method.body: @Override
      public RawLocationReference decodeData(LocationReference data) throws PhysicalFormatException {
          LocationType locationType = data.getLocationType();
          LocationReferenceDecoder locationReferenceDecoder = locationTypeDecoderRegistry.getDecoder(locationType);
  
          if (locationReferenceDecoder == null) {
              throw new OpenLRProtoException(OpenLRProtoStatusCode.UNSUPPORTED_LOCATION_TYPE);
          }
  
          Object locationReferenceData = data.getLocationReferenceData();
  
          if (!(locationReferenceData instanceof LocationReferenceData)) {
              throw new OpenLRProtoException(OpenLRProtoStatusCode.INVALID_DATA_TYPE);
          }
  
          return locationReferenceDecoder.decode(data.getID(), (LocationReferenceData) locationReferenceData);
      }
focal_method.class_method_signature: OpenLRProtoDecoder.decodeData(LocationReference data)
focal_method.full_signature: @Override public RawLocationReference decodeData(LocationReference data)
focal_method.identifier: decodeData
focal_method.invocations: getLocationType getDecoder getLocationReferenceData decode getID
focal_method.modifiers: @Override public
focal_method.parameters: (LocationReference data)
focal_method.return: RawLocationReference
focal_method.signature: RawLocationReference decodeData(LocationReference data)