RegionEvent extends Event implements JsonSerializable { private RegionEvent(@NonNull RegionEvent.Builder builder) { this.regionId = builder.regionId; this.source = builder.source; this.boundaryEvent = builder.boundaryEvent; this.circularRegion = builder.circularRegion; this.proximityRegion = builder.proximityRegion; } private  RegionEvent(@NonNull RegionEvent.Builder builder); @NonNull static Builder newBuilder(); @NonNull @Override final String getType(); @Boundary int getBoundaryEvent(); @NonNull @Override @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) final JsonMap getEventData(); @NonNull @Override JsonValue toJsonValue(); @Override boolean isValid(); @Override @Priority int getPriority(); @NonNull
    static final String TYPE; @NonNull
    static final String REGION_ID; static final int BOUNDARY_EVENT_ENTER; static final int BOUNDARY_EVENT_EXIT; static final int MAX_CHARACTER_LENGTH; static final double MAX_LATITUDE; static final double MIN_LATITUDE; static final double MAX_LONGITUDE; static final double MIN_LONGITUDE; }
@Test public void testRegionEvent() throws JSONException { String regionId = createFixedSizeString('a', 255); String source = createFixedSizeString('b', 255); int boundaryEvent = RegionEvent.BOUNDARY_EVENT_ENTER; RegionEvent event = RegionEvent.newBuilder() .setRegionId(regionId) .setSource(source) .setBoundaryEvent(boundaryEvent) .build(); EventTestUtils.validateEventValue(event, "region_id", regionId); EventTestUtils.validateEventValue(event, "source", source); EventTestUtils.validateEventValue(event, "action", "enter"); assertTrue(event.isValid()); }