Merge pull request #8384 from kwoyke/BAEL-19947

BAEL-19947: Standardize packages for gson, guava and httpclient modules
This commit is contained in:
Josh Cummings 2019-12-17 22:44:32 -07:00 committed by GitHub
commit c20e18723b
87 changed files with 183 additions and 187 deletions

View File

@ -1,4 +1,4 @@
package org.baeldung.gson.entities;
package com.baeldung.gson.entities;
import java.text.DateFormat;
import java.text.SimpleDateFormat;

View File

@ -1,4 +1,4 @@
package org.baeldung.gson.entities;
package com.baeldung.gson.entities;
public abstract class Animal {
public String type = "Animal";

View File

@ -1,4 +1,4 @@
package org.baeldung.gson.entities;
package com.baeldung.gson.entities;
public class Cow extends Animal {
private String breed;

View File

@ -1,4 +1,4 @@
package org.baeldung.gson.entities;
package com.baeldung.gson.entities;
public class Dog extends Animal {
private String petName;

View File

@ -1,4 +1,4 @@
package org.baeldung.gson.entities;
package com.baeldung.gson.entities;
public class Employee {
private int id;

View File

@ -1,4 +1,4 @@
package org.baeldung.gson.entities;
package com.baeldung.gson.entities;
import java.util.List;

View File

@ -1,4 +1,4 @@
package org.baeldung.gson.entities;
package com.baeldung.gson.entities;
import com.google.gson.annotations.Expose;

View File

@ -1,4 +1,4 @@
package org.baeldung.gson.entities;
package com.baeldung.gson.entities;
import java.util.Objects;

View File

@ -1,4 +1,4 @@
package org.baeldung.gson.entities;
package com.baeldung.gson.entities;
public class User {

View File

@ -1,4 +1,4 @@
package org.baeldung.gson.entities;
package com.baeldung.gson.entities;
import com.google.gson.annotations.SerializedName;

View File

@ -1,4 +1,4 @@
package org.baeldung.gson.primitives.models;
package com.baeldung.gson.primitives.models;
public class BooleanExample {
public boolean value;

View File

@ -1,4 +1,4 @@
package org.baeldung.gson.primitives.models;
package com.baeldung.gson.primitives.models;
public class ByteExample {
public byte value = (byte) 1;

View File

@ -1,4 +1,4 @@
package org.baeldung.gson.primitives.models;
package com.baeldung.gson.primitives.models;
public class CharExample {
public char value;

View File

@ -1,4 +1,4 @@
package org.baeldung.gson.primitives.models;
package com.baeldung.gson.primitives.models;
public class DoubleExample {
public double value;

View File

@ -1,4 +1,4 @@
package org.baeldung.gson.primitives.models;
package com.baeldung.gson.primitives.models;
public class FloatExample {
public float value;

View File

@ -1,4 +1,4 @@
package org.baeldung.gson.primitives.models;
package com.baeldung.gson.primitives.models;
public class InfinityValuesExample {
public float negativeInfinity;

View File

@ -1,4 +1,4 @@
package org.baeldung.gson.primitives.models;
package com.baeldung.gson.primitives.models;
public class LongExample {
public long value = 1;

View File

@ -1,4 +1,4 @@
package org.baeldung.gson.primitives.models;
package com.baeldung.gson.primitives.models;
public class PrimitiveBundle {
public byte byteValue;

View File

@ -1,4 +1,4 @@
package org.baeldung.gson.primitives.models;
package com.baeldung.gson.primitives.models;
public class PrimitiveBundleInitialized {
// @formatter:off

View File

@ -1,11 +1,11 @@
package org.baeldung.gson.serialization;
package com.baeldung.gson.serialization;
import java.lang.reflect.Type;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import org.baeldung.gson.entities.ActorGson;
import com.baeldung.gson.entities.ActorGson;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;

View File

@ -1,10 +1,10 @@
package org.baeldung.gson.serialization;
package com.baeldung.gson.serialization;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;
import org.baeldung.gson.entities.ActorGson;
import com.baeldung.gson.entities.ActorGson;
import java.lang.reflect.Type;
import java.text.SimpleDateFormat;

View File

@ -1,4 +1,4 @@
package org.baeldung.gson.serialization;
package com.baeldung.gson.serialization;
import com.google.gson.Gson;
import com.google.gson.JsonDeserializationContext;
@ -8,7 +8,7 @@ import com.google.gson.JsonObject;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.Map;
import org.baeldung.gson.entities.Animal;
import com.baeldung.gson.entities.Animal;
public class AnimalDeserializer implements JsonDeserializer<Animal> {
private String animalTypeElementName;

View File

@ -1,12 +1,11 @@
package org.baeldung.gson.serialization;
package com.baeldung.gson.serialization;
import java.lang.reflect.Type;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
import java.util.stream.Collectors;
import org.baeldung.gson.entities.Employee;
import com.baeldung.gson.entities.Employee;
import com.google.gson.*;

View File

@ -1,4 +1,4 @@
package org.baeldung.gson.serialization;
package com.baeldung.gson.serialization;
import java.lang.reflect.Type;
import java.text.ParseException;

View File

@ -1,4 +1,4 @@
package org.baeldung.gson.serializationwithexclusions;
package com.baeldung.gson.serializationwithexclusions;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;

View File

@ -1,4 +1,4 @@
package org.baeldung.gson.serializationwithexclusions;
package com.baeldung.gson.serializationwithexclusions;
import lombok.AllArgsConstructor;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package org.baeldung.gson.serializationwithexclusions;
package com.baeldung.gson.serializationwithexclusions;
import com.google.gson.annotations.Expose;

View File

@ -1,4 +1,4 @@
package org.baeldung.gson.serializationwithexclusions;
package com.baeldung.gson.serializationwithexclusions;
import lombok.AllArgsConstructor;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package org.baeldung.gson.serializationwithexclusions;
package com.baeldung.gson.serializationwithexclusions;
import lombok.AllArgsConstructor;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package org.baeldung.gson.serializationwithexclusions;
package com.baeldung.gson.serializationwithexclusions;
import lombok.AllArgsConstructor;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package org.baeldung.gson.serializationwithexclusions;
package com.baeldung.gson.serializationwithexclusions;
import com.google.gson.annotations.Expose;

View File

@ -1,4 +1,4 @@
package org.baeldung.gson.serializationwithexclusions;
package com.baeldung.gson.serializationwithexclusions;
import lombok.AllArgsConstructor;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package org.baeldung.gson.serializationwithexclusions;
package com.baeldung.gson.serializationwithexclusions;
import lombok.AllArgsConstructor;
import lombok.Data;

View File

@ -1,8 +1,9 @@
package org.baeldung.gson.advance;
package com.baeldung.gson.advance;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import com.baeldung.gson.entities.Dog;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
@ -10,11 +11,10 @@ import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.baeldung.gson.entities.Animal;
import org.baeldung.gson.entities.Cow;
import org.baeldung.gson.entities.Dog;
import org.baeldung.gson.entities.MyClass;
import org.baeldung.gson.serialization.AnimalDeserializer;
import com.baeldung.gson.entities.Animal;
import com.baeldung.gson.entities.Cow;
import com.baeldung.gson.entities.MyClass;
import com.baeldung.gson.serialization.AnimalDeserializer;
import org.junit.Test;
public class GsonAdvanceUnitTest {

View File

@ -1,4 +1,4 @@
package org.baeldung.gson.advance;
package com.baeldung.gson.advance;
/*
* Copyright (C) 2011 Google Inc.

View File

@ -1,4 +1,4 @@
package org.baeldung.gson.conversion;
package com.baeldung.gson.conversion;
import com.google.gson.*;
import org.junit.Assert;

View File

@ -1,4 +1,4 @@
package org.baeldung.gson.deserialization;
package com.baeldung.gson.deserialization;
public class Foo {
public int intValue;

View File

@ -1,4 +1,4 @@
package org.baeldung.gson.deserialization;
package com.baeldung.gson.deserialization;
import java.lang.reflect.Type;

View File

@ -1,4 +1,4 @@
package org.baeldung.gson.deserialization;
package com.baeldung.gson.deserialization;
import java.lang.reflect.Type;

View File

@ -1,4 +1,4 @@
package org.baeldung.gson.deserialization;
package com.baeldung.gson.deserialization;
import java.lang.reflect.Type;

View File

@ -1,4 +1,4 @@
package org.baeldung.gson.deserialization;
package com.baeldung.gson.deserialization;
public class FooWithInner {
public int intValue;

View File

@ -1,4 +1,4 @@
package org.baeldung.gson.deserialization;
package com.baeldung.gson.deserialization;
public class GenericFoo<T> {

View File

@ -1,8 +1,8 @@
package org.baeldung.gson.deserialization;
package com.baeldung.gson.deserialization;
import static org.junit.Assert.assertEquals;
import org.baeldung.gson.entities.Weather;
import com.baeldung.gson.entities.Weather;
import org.junit.Test;
import com.google.gson.Gson;

View File

@ -1,10 +1,10 @@
package org.baeldung.gson.deserialization;
package com.baeldung.gson.deserialization;
import java.text.ParseException;
import org.baeldung.gson.entities.ActorGson;
import org.baeldung.gson.entities.Movie;
import org.baeldung.gson.serialization.ActorGsonDeserializer;
import com.baeldung.gson.entities.Movie;
import com.baeldung.gson.serialization.ActorGsonDeserializer;
import com.baeldung.gson.entities.ActorGson;
import org.junit.Assert;
import org.junit.Test;

View File

@ -1,4 +1,4 @@
package org.baeldung.gson.deserialization;
package com.baeldung.gson.deserialization;
import java.lang.reflect.Type;
import java.text.ParseException;
@ -6,9 +6,9 @@ import java.util.Date;
import java.util.Map;
import org.apache.commons.lang3.time.DateUtils;
import org.baeldung.gson.entities.Employee;
import org.baeldung.gson.serialization.MapDeserializer;
import org.baeldung.gson.serialization.StringDateMapDeserializer;
import com.baeldung.gson.entities.Employee;
import com.baeldung.gson.serialization.MapDeserializer;
import com.baeldung.gson.serialization.StringDateMapDeserializer;
import org.junit.Assert;
import org.junit.Test;
import org.slf4j.Logger;

View File

@ -1,4 +1,4 @@
package org.baeldung.gson.deserialization.test;
package com.baeldung.gson.deserialization.test;
import static org.hamcrest.Matchers.hasItem;
import static org.hamcrest.Matchers.instanceOf;
@ -10,11 +10,11 @@ import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.Collection;
import org.baeldung.gson.deserialization.Foo;
import org.baeldung.gson.deserialization.FooDeserializerFromJsonWithDifferentFields;
import org.baeldung.gson.deserialization.FooInstanceCreator;
import org.baeldung.gson.deserialization.FooWithInner;
import org.baeldung.gson.deserialization.GenericFoo;
import com.baeldung.gson.deserialization.Foo;
import com.baeldung.gson.deserialization.FooDeserializerFromJsonWithDifferentFields;
import com.baeldung.gson.deserialization.FooInstanceCreator;
import com.baeldung.gson.deserialization.FooWithInner;
import com.baeldung.gson.deserialization.GenericFoo;
import org.junit.Test;
import com.google.common.collect.Lists;

View File

@ -1,7 +1,7 @@
package org.baeldung.gson.primitives;
package com.baeldung.gson.primitives;
import com.baeldung.gson.primitives.models.*;
import com.google.gson.*;
import org.baeldung.gson.primitives.models.*;
import org.junit.Test;
import java.lang.reflect.Type;

View File

@ -1,4 +1,4 @@
package org.baeldung.gson.serialization;
package com.baeldung.gson.serialization;
import java.lang.reflect.Type;

View File

@ -1,11 +1,11 @@
package org.baeldung.gson.serialization;
package com.baeldung.gson.serialization;
import com.baeldung.gson.entities.Movie;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonParser;
import org.baeldung.gson.entities.ActorGson;
import org.baeldung.gson.entities.Movie;
import org.baeldung.gson.entities.MovieWithNullValue;
import com.baeldung.gson.entities.ActorGson;
import com.baeldung.gson.entities.MovieWithNullValue;
import org.junit.Assert;
import org.junit.Test;

View File

@ -1,4 +1,4 @@
package org.baeldung.gson.serialization;
package com.baeldung.gson.serialization;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;

View File

@ -1,4 +1,4 @@
package org.baeldung.gson.serialization;
package com.baeldung.gson.serialization;
import java.lang.reflect.Type;

View File

@ -1,4 +1,4 @@
package org.baeldung.gson.serialization;
package com.baeldung.gson.serialization;
public class SourceClass {
private int intValue;

View File

@ -1,18 +1,16 @@
package org.baeldung.gson.serialization.test;
package com.baeldung.gson.serialization.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.lang.reflect.Type;
import java.util.Calendar;
import java.util.Collection;
import java.util.Date;
import java.util.GregorianCalendar;
import org.baeldung.gson.serialization.DifferentNameSerializer;
import org.baeldung.gson.serialization.IgnoringFieldsNotMatchingCriteriaSerializer;
import org.baeldung.gson.serialization.IgnoringFieldsSerializer;
import org.baeldung.gson.serialization.SourceClass;
import com.baeldung.gson.serialization.DifferentNameSerializer;
import com.baeldung.gson.serialization.IgnoringFieldsNotMatchingCriteriaSerializer;
import com.baeldung.gson.serialization.IgnoringFieldsSerializer;
import com.baeldung.gson.serialization.SourceClass;
import org.joda.time.DateTime;
import org.junit.Test;

View File

@ -1,4 +1,4 @@
package org.baeldung.gson.serialization.test;
package com.baeldung.gson.serialization.test;
import java.io.FileWriter;
import java.io.IOException;
@ -6,7 +6,7 @@ import java.io.Writer;
import java.nio.file.Files;
import java.nio.file.Paths;
import org.baeldung.gson.entities.User;
import com.baeldung.gson.entities.User;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;

View File

@ -1,4 +1,4 @@
package org.baeldung.gson.serializationwithexclusions;
package com.baeldung.gson.serializationwithexclusions;
import static org.junit.jupiter.api.Assertions.assertEquals;

View File

@ -1,4 +1,4 @@
package org.baeldung.guava;
package com.baeldung.guava;
public class CustomEvent {
private String action;

View File

@ -1,4 +1,4 @@
package org.baeldung.guava;
package com.baeldung.guava;
import com.google.common.eventbus.DeadEvent;
import com.google.common.eventbus.Subscribe;

View File

@ -1,4 +1,4 @@
package org.baeldung.guava.memoizer;
package com.baeldung.guava.memoizer;
import java.math.BigInteger;
import java.util.Random;

View File

@ -1,4 +1,4 @@
package org.baeldung.guava.memoizer;
package com.baeldung.guava.memoizer;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;

View File

@ -1,11 +1,10 @@
package org.baeldung.guava.memoizer;
package com.baeldung.guava.memoizer;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import java.math.BigInteger;
import java.util.concurrent.TimeUnit;
public class FibonacciSequence {

View File

@ -1,4 +1,4 @@
package org.baeldung.guava;
package com.baeldung.guava;
import com.google.common.hash.BloomFilter;

View File

@ -1,4 +1,4 @@
package org.baeldung.guava;
package com.baeldung.guava;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

View File

@ -1,4 +1,4 @@
package org.baeldung.guava;
package com.baeldung.guava;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;

View File

@ -1,4 +1,4 @@
package org.baeldung.guava;
package com.baeldung.guava;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;

View File

@ -1,4 +1,4 @@
package org.baeldung.guava;
package com.baeldung.guava;
import static org.junit.Assert.*;

View File

@ -1,4 +1,4 @@
package org.baeldung.guava;
package com.baeldung.guava;
import com.google.common.eventbus.EventBus;
import org.junit.After;

View File

@ -1,4 +1,4 @@
package org.baeldung.guava;
package com.baeldung.guava;
import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.equalTo;

View File

@ -1,4 +1,4 @@
package org.baeldung.guava;
package com.baeldung.guava;
import static org.junit.Assert.*;

View File

@ -1,4 +1,4 @@
package org.baeldung.guava;
package com.baeldung.guava;
import static org.junit.Assert.*;

View File

@ -1,4 +1,4 @@
package org.baeldung.guava;
package com.baeldung.guava;
import static org.hamcrest.core.IsEqual.equalTo;
import static org.junit.Assert.*;

View File

@ -1,9 +1,9 @@
package org.baeldung.guava;
package com.baeldung.guava;
import com.google.common.base.Suppliers;
import org.baeldung.guava.memoizer.CostlySupplier;
import org.baeldung.guava.memoizer.Factorial;
import org.baeldung.guava.memoizer.FibonacciSequence;
import com.baeldung.guava.memoizer.CostlySupplier;
import com.baeldung.guava.memoizer.Factorial;
import com.baeldung.guava.memoizer.FibonacciSequence;
import org.junit.Test;
import java.math.BigInteger;

View File

@ -1,4 +1,4 @@
package org.baeldung.guava;
package com.baeldung.guava;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import java.util.Arrays;

View File

@ -1,4 +1,4 @@
package org.baeldung.guava;
package com.baeldung.guava;
import com.google.common.collect.Lists;

View File

@ -1,4 +1,4 @@
package org.baeldung.guava;
package com.baeldung.guava;
import com.google.common.util.concurrent.RateLimiter;

View File

@ -1,4 +1,4 @@
package org.baeldung.httpclient;
package com.baeldung.httpclient;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;

View File

@ -1,4 +1,4 @@
package org.baeldung.httpclient;
package com.baeldung.httpclient;
import org.apache.http.HttpEntity;
import org.apache.http.HttpStatus;
@ -38,7 +38,7 @@ public class HttpClientMultipartLiveTest {
private static final String TEXTFILENAME = "temp.txt";
private static final String IMAGEFILENAME = "image.jpg";
private static final String ZIPFILENAME = "zipFile.zip";
private static final Logger LOGGER = Logger.getLogger("org.baeldung.httpclient.HttpClientMultipartLiveTest");
private static final Logger LOGGER = Logger.getLogger("com.baeldung.httpclient.HttpClientMultipartLiveTest");
private CloseableHttpClient client;
private HttpPost post;
private BufferedReader rd;

View File

@ -1,4 +1,4 @@
package org.baeldung.httpclient;
package com.baeldung.httpclient;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;

View File

@ -1,4 +1,4 @@
package org.baeldung.httpclient;
package com.baeldung.httpclient;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;

View File

@ -1,4 +1,4 @@
package org.baeldung.httpclient.advancedconfig;
package com.baeldung.httpclient.advancedconfig;
import com.github.tomakehurst.wiremock.junit.WireMockRule;

View File

@ -1,5 +1,6 @@
package org.baeldung.httpclient.base;
package com.baeldung.httpclient.base;
import com.baeldung.httpclient.ResponseUtil;
import org.apache.http.auth.AuthenticationException;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.methods.CloseableHttpResponse;
@ -8,7 +9,6 @@ import org.apache.http.entity.StringEntity;
import org.apache.http.impl.auth.BasicScheme;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.baeldung.httpclient.ResponseUtil;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

View File

@ -1,5 +1,6 @@
package org.baeldung.httpclient.base;
package com.baeldung.httpclient.base;
import com.baeldung.httpclient.ResponseUtil;
import org.apache.http.Header;
import org.apache.http.HttpEntity;
import org.apache.http.HttpHeaders;
@ -11,7 +12,6 @@ import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.impl.conn.BasicHttpClientConnectionManager;
import org.baeldung.httpclient.ResponseUtil;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

View File

@ -1,5 +1,6 @@
package org.baeldung.httpclient.base;
package com.baeldung.httpclient.base;
import com.baeldung.httpclient.ResponseUtil;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.CredentialsProvider;
@ -8,7 +9,6 @@ import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.BasicCredentialsProvider;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.baeldung.httpclient.ResponseUtil;
import org.junit.Test;
import java.io.IOException;

View File

@ -1,4 +1,4 @@
package org.baeldung.httpclient.conn;
package com.baeldung.httpclient.conn;
import org.apache.http.HeaderElement;
import org.apache.http.HeaderElementIterator;

View File

@ -1,4 +1,4 @@
package org.baeldung.httpclient.conn;
package com.baeldung.httpclient.conn;
import java.util.concurrent.TimeUnit;

View File

@ -1,4 +1,4 @@
package org.baeldung.httpclient.conn;
package com.baeldung.httpclient.conn;
import java.io.IOException;

View File

@ -1,4 +1,4 @@
package org.baeldung.httpclient.conn;
package com.baeldung.httpclient.conn;
import java.io.IOException;

View File

@ -1,4 +1,4 @@
package org.baeldung.httpclient.rare;
package com.baeldung.httpclient.rare;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;