Skip to content

Commit 6390efc

Browse files
frsyukikomamitsu
authored andcommitted
renamed org.msgpack.jackson.dataformat.MessagePackFactory to MessagePackFormatFactory to avoid name confusion
1 parent 4098489 commit 6390efc

File tree

9 files changed

+35
-35
lines changed

9 files changed

+35
-35
lines changed

msgpack-jackson/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ dependencies {
2929

3030
## Usage
3131

32-
Only thing you need to do is to instantiate MessagePackFactory and pass it to the constructor of ObjectMapper.
32+
Only thing you need to do is to instantiate MessagePackFormatFactory and pass it to the constructor of ObjectMapper.
3333

3434
```
35-
ObjectMapper objectMapper = new ObjectMapper(new MessagePackFactory());
35+
ObjectMapper objectMapper = new ObjectMapper(new MessagePackFormatFactory());
3636
ExamplePojo orig = new ExamplePojo("komamitsu");
3737
byte[] bytes = objectMapper.writeValueAsBytes(orig);
3838
ExamplePojo value = objectMapper.readValue(bytes, ExamplePojo.class);

msgpack-jackson/src/main/java/org/msgpack/jackson/dataformat/MessagePackFactory.java renamed to msgpack-jackson/src/main/java/org/msgpack/jackson/dataformat/MessagePackFormatFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
import java.io.Writer;
3131
import java.util.Arrays;
3232

33-
public class MessagePackFactory
33+
public class MessagePackFormatFactory
3434
extends JsonFactory
3535
{
3636
private static final long serialVersionUID = 2578263992015504347L;

msgpack-jackson/src/test/java/org/msgpack/jackson/dataformat/ExampleOfTypeInformationSerDe.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public void test()
151151
objectContainer.getObjects().put("pi", pi);
152152
}
153153

154-
ObjectMapper objectMapper = new ObjectMapper(new MessagePackFactory());
154+
ObjectMapper objectMapper = new ObjectMapper(new MessagePackFormatFactory());
155155
byte[] bytes = objectMapper.writeValueAsBytes(objectContainer);
156156
ObjectContainer restored = objectMapper.readValue(bytes, ObjectContainer.class);
157157

msgpack-jackson/src/test/java/org/msgpack/jackson/dataformat/MessagePackDataformatTestBase.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
public class MessagePackDataformatTestBase
3737
{
38-
protected MessagePackFactory factory;
38+
protected MessagePackFormatFactory factory;
3939
protected ByteArrayOutputStream out;
4040
protected ByteArrayInputStream in;
4141
protected ObjectMapper objectMapper;
@@ -47,7 +47,7 @@ public class MessagePackDataformatTestBase
4747
@Before
4848
public void setup()
4949
{
50-
factory = new MessagePackFactory();
50+
factory = new MessagePackFormatFactory();
5151
objectMapper = new ObjectMapper(factory);
5252
out = new ByteArrayOutputStream();
5353
in = new ByteArrayInputStream(new byte[4096]);

msgpack-jackson/src/test/java/org/msgpack/jackson/dataformat/MessagePackFactoryTest.java renamed to msgpack-jackson/src/test/java/org/msgpack/jackson/dataformat/MessagePackFormatFactoryTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
import static org.junit.Assert.assertEquals;
2626

27-
public class MessagePackFactoryTest
27+
public class MessagePackFormatFactoryTest
2828
extends MessagePackDataformatTestBase
2929
{
3030
@Test

msgpack-jackson/src/test/java/org/msgpack/jackson/dataformat/MessagePackGeneratorTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ else if (key.equals("num")) {
230230
public void testMessagePackGeneratorDirectly()
231231
throws Exception
232232
{
233-
MessagePackFactory messagePackFactory = new MessagePackFactory();
233+
MessagePackFormatFactory messagePackFactory = new MessagePackFormatFactory();
234234
File tempFile = createTempFile();
235235

236236
JsonGenerator generator = messagePackFactory.createGenerator(tempFile, JsonEncoding.UTF8);
@@ -257,7 +257,7 @@ public void testMessagePackGeneratorDirectly()
257257
public void testWritePrimitives()
258258
throws Exception
259259
{
260-
MessagePackFactory messagePackFactory = new MessagePackFactory();
260+
MessagePackFormatFactory messagePackFactory = new MessagePackFormatFactory();
261261
File tempFile = createTempFile();
262262

263263
JsonGenerator generator = messagePackFactory.createGenerator(tempFile, JsonEncoding.UTF8);
@@ -280,7 +280,7 @@ public void testWritePrimitives()
280280
public void testBigDecimal()
281281
throws IOException
282282
{
283-
ObjectMapper mapper = new ObjectMapper(new MessagePackFactory());
283+
ObjectMapper mapper = new ObjectMapper(new MessagePackFormatFactory());
284284

285285
{
286286
double d0 = 1.23456789;
@@ -328,7 +328,7 @@ public void testEnableFeatureAutoCloseTarget()
328328
throws IOException
329329
{
330330
OutputStream out = createTempFileOutputStream();
331-
MessagePackFactory messagePackFactory = new MessagePackFactory();
331+
MessagePackFormatFactory messagePackFactory = new MessagePackFormatFactory();
332332
ObjectMapper objectMapper = new ObjectMapper(messagePackFactory);
333333
List<Integer> integers = Arrays.asList(1);
334334
objectMapper.writeValue(out, integers);
@@ -341,7 +341,7 @@ public void testDisableFeatureAutoCloseTarget()
341341
{
342342
File tempFile = createTempFile();
343343
OutputStream out = new FileOutputStream(tempFile);
344-
MessagePackFactory messagePackFactory = new MessagePackFactory();
344+
MessagePackFormatFactory messagePackFactory = new MessagePackFormatFactory();
345345
ObjectMapper objectMapper = new ObjectMapper(messagePackFactory);
346346
objectMapper.configure(JsonGenerator.Feature.AUTO_CLOSE_TARGET, false);
347347
List<Integer> integers = Arrays.asList(1);
@@ -363,7 +363,7 @@ public void testWritePrimitiveObjectViaObjectMapper()
363363
File tempFile = createTempFile();
364364
OutputStream out = new FileOutputStream(tempFile);
365365

366-
ObjectMapper objectMapper = new ObjectMapper(new MessagePackFactory());
366+
ObjectMapper objectMapper = new ObjectMapper(new MessagePackFormatFactory());
367367
objectMapper.configure(JsonGenerator.Feature.AUTO_CLOSE_TARGET, false);
368368
objectMapper.writeValue(out, 1);
369369
objectMapper.writeValue(out, "two");

msgpack-jackson/src/test/java/org/msgpack/jackson/dataformat/MessagePackParserTest.java

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ else if (k.equals("child_map_age")) {
288288
public void testMessagePackParserDirectly()
289289
throws IOException
290290
{
291-
MessagePackFactory messagePackFactory = new MessagePackFactory();
291+
MessagePackFormatFactory factory = new MessagePackFormatFactory();
292292
File tempFile = File.createTempFile("msgpackTest", "msgpack");
293293
tempFile.deleteOnExit();
294294

@@ -301,7 +301,7 @@ public void testMessagePackParserDirectly()
301301
packer.packFloat(1.0f);
302302
packer.close();
303303

304-
JsonParser parser = messagePackFactory.createParser(tempFile);
304+
JsonParser parser = factory.createParser(tempFile);
305305
assertTrue(parser instanceof MessagePackParser);
306306

307307
JsonToken jsonToken = parser.nextToken();
@@ -354,7 +354,7 @@ public void testMessagePackParserDirectly()
354354
public void testReadPrimitives()
355355
throws Exception
356356
{
357-
MessagePackFactory messagePackFactory = new MessagePackFactory();
357+
MessagePackFormatFactory factory = new MessagePackFormatFactory();
358358
File tempFile = createTempFile();
359359

360360
FileOutputStream out = new FileOutputStream(tempFile);
@@ -367,7 +367,7 @@ public void testReadPrimitives()
367367
packer.writePayload(bytes);
368368
packer.close();
369369

370-
JsonParser parser = messagePackFactory.createParser(new FileInputStream(tempFile));
370+
JsonParser parser = factory.createParser(new FileInputStream(tempFile));
371371
assertEquals(JsonToken.VALUE_STRING, parser.nextToken());
372372
assertEquals("foo", parser.getText());
373373
assertEquals(JsonToken.VALUE_NUMBER_FLOAT, parser.nextToken());
@@ -396,7 +396,7 @@ public void testBigDecimal()
396396
packer.packDouble(Double.MIN_NORMAL);
397397
packer.flush();
398398

399-
ObjectMapper mapper = new ObjectMapper(new MessagePackFactory());
399+
ObjectMapper mapper = new ObjectMapper(new MessagePackFormatFactory());
400400
mapper.configure(DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS, true);
401401
List<Object> objects = mapper.readValue(out.toByteArray(), new TypeReference<List<Object>>() {});
402402
assertEquals(5, objects.size());
@@ -431,9 +431,9 @@ public void testEnableFeatureAutoCloseSource()
431431
throws Exception
432432
{
433433
File tempFile = createTestFile();
434-
MessagePackFactory messagePackFactory = new MessagePackFactory();
434+
MessagePackFormatFactory factory = new MessagePackFormatFactory();
435435
FileInputStream in = new FileInputStream(tempFile);
436-
ObjectMapper objectMapper = new ObjectMapper(messagePackFactory);
436+
ObjectMapper objectMapper = new ObjectMapper(factory);
437437
objectMapper.readValue(in, new TypeReference<List<Integer>>() {});
438438
objectMapper.readValue(in, new TypeReference<List<Integer>>() {});
439439
}
@@ -444,7 +444,7 @@ public void testDisableFeatureAutoCloseSource()
444444
{
445445
File tempFile = createTestFile();
446446
FileInputStream in = new FileInputStream(tempFile);
447-
ObjectMapper objectMapper = new ObjectMapper(new MessagePackFactory());
447+
ObjectMapper objectMapper = new ObjectMapper(new MessagePackFormatFactory());
448448
objectMapper.configure(JsonParser.Feature.AUTO_CLOSE_SOURCE, false);
449449
objectMapper.readValue(in, new TypeReference<List<Integer>>() {});
450450
objectMapper.readValue(in, new TypeReference<List<Integer>>() {});
@@ -456,7 +456,7 @@ public void testParseBigDecimal()
456456
{
457457
ArrayList<BigDecimal> list = new ArrayList<BigDecimal>();
458458
list.add(new BigDecimal(Long.MAX_VALUE));
459-
ObjectMapper objectMapper = new ObjectMapper(new MessagePackFactory());
459+
ObjectMapper objectMapper = new ObjectMapper(new MessagePackFormatFactory());
460460
byte[] bytes = objectMapper.writeValueAsBytes(list);
461461

462462
ArrayList<BigDecimal> result = objectMapper.readValue(
@@ -481,7 +481,7 @@ public void testReadPrimitiveObjectViaObjectMapper()
481481
packer.close();
482482

483483
FileInputStream in = new FileInputStream(tempFile);
484-
ObjectMapper objectMapper = new ObjectMapper(new MessagePackFactory());
484+
ObjectMapper objectMapper = new ObjectMapper(new MessagePackFormatFactory());
485485
objectMapper.configure(JsonParser.Feature.AUTO_CLOSE_SOURCE, false);
486486
assertEquals("foo", objectMapper.readValue(in, new TypeReference<String>() {}));
487487
long l = objectMapper.readValue(in, new TypeReference<Long>() {});
@@ -511,7 +511,7 @@ public void testBinaryKey()
511511
packer.packLong(42);
512512
packer.close();
513513

514-
ObjectMapper mapper = new ObjectMapper(new MessagePackFactory());
514+
ObjectMapper mapper = new ObjectMapper(new MessagePackFormatFactory());
515515
Map<String, Object> object = mapper.readValue(new FileInputStream(tempFile), new TypeReference<Map<String, Object>>() {});
516516
assertEquals(2, object.size());
517517
assertEquals(3.14, object.get("foo"));
@@ -533,7 +533,7 @@ public void testBinaryKeyInNestedObject()
533533
packer.packInt(1);
534534
packer.close();
535535

536-
ObjectMapper mapper = new ObjectMapper(new MessagePackFactory());
536+
ObjectMapper mapper = new ObjectMapper(new MessagePackFormatFactory());
537537
List<Object> objects = mapper.readValue(out.toByteArray(), new TypeReference<List<Object>>() {});
538538
assertEquals(2, objects.size());
539539
@SuppressWarnings(value = "unchecked")
@@ -555,7 +555,7 @@ public void testByteArrayKey()
555555
messagePacker.packBinaryHeader(1).writePayload(k1).packInt(3);
556556
messagePacker.close();
557557

558-
ObjectMapper objectMapper = new ObjectMapper(new MessagePackFactory());
558+
ObjectMapper objectMapper = new ObjectMapper(new MessagePackFormatFactory());
559559
SimpleModule module = new SimpleModule();
560560
module.addKeyDeserializer(byte[].class, new KeyDeserializer()
561561
{
@@ -592,7 +592,7 @@ public void testIntegerKey()
592592
}
593593
messagePacker.close();
594594

595-
ObjectMapper objectMapper = new ObjectMapper(new MessagePackFactory());
595+
ObjectMapper objectMapper = new ObjectMapper(new MessagePackFormatFactory());
596596
SimpleModule module = new SimpleModule();
597597
module.addKeyDeserializer(Integer.class, new KeyDeserializer()
598598
{
@@ -623,7 +623,7 @@ public void testFloatKey()
623623
}
624624
messagePacker.close();
625625

626-
ObjectMapper objectMapper = new ObjectMapper(new MessagePackFactory());
626+
ObjectMapper objectMapper = new ObjectMapper(new MessagePackFormatFactory());
627627
SimpleModule module = new SimpleModule();
628628
module.addKeyDeserializer(Float.class, new KeyDeserializer()
629629
{
@@ -653,7 +653,7 @@ public void testBooleanKey()
653653
messagePacker.packBoolean(false).packInt(3);
654654
messagePacker.close();
655655

656-
ObjectMapper objectMapper = new ObjectMapper(new MessagePackFactory());
656+
ObjectMapper objectMapper = new ObjectMapper(new MessagePackFormatFactory());
657657
SimpleModule module = new SimpleModule();
658658
module.addKeyDeserializer(Boolean.class, new KeyDeserializer()
659659
{

msgpack-jackson/src/test/java/org/msgpack/jackson/dataformat/benchmark/MessagePackDataformatHugeDataBenchmarkTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import com.fasterxml.jackson.core.type.TypeReference;
2121
import com.fasterxml.jackson.databind.ObjectMapper;
2222
import org.junit.Test;
23-
import org.msgpack.jackson.dataformat.MessagePackFactory;
23+
import org.msgpack.jackson.dataformat.MessagePackFormatFactory;
2424

2525
import java.io.File;
2626
import java.io.FileOutputStream;
@@ -34,7 +34,7 @@ public class MessagePackDataformatHugeDataBenchmarkTest
3434
private static final int COUNT = 6;
3535
private static final int WARMUP_COUNT = 4;
3636
private final ObjectMapper origObjectMapper = new ObjectMapper();
37-
private final ObjectMapper msgpackObjectMapper = new ObjectMapper(new MessagePackFactory());
37+
private final ObjectMapper msgpackObjectMapper = new ObjectMapper(new MessagePackFormatFactory());
3838
private static final List<Object> value;
3939
private static final byte[] packedByOriginal;
4040
private static final byte[] packedByMsgPack;
@@ -61,7 +61,7 @@ public class MessagePackDataformatHugeDataBenchmarkTest
6161
packedByOriginal = bytes;
6262

6363
try {
64-
bytes = new ObjectMapper(new MessagePackFactory()).writeValueAsBytes(value);
64+
bytes = new ObjectMapper(new MessagePackFormatFactory()).writeValueAsBytes(value);
6565
}
6666
catch (JsonProcessingException e) {
6767
e.printStackTrace();

msgpack-jackson/src/test/java/org/msgpack/jackson/dataformat/benchmark/MessagePackDataformatPojoBenchmarkTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import com.fasterxml.jackson.core.JsonProcessingException;
2020
import com.fasterxml.jackson.databind.ObjectMapper;
2121
import org.junit.Test;
22-
import org.msgpack.jackson.dataformat.MessagePackFactory;
22+
import org.msgpack.jackson.dataformat.MessagePackFormatFactory;
2323
import static org.msgpack.jackson.dataformat.MessagePackDataformatTestBase.NormalPojo;
2424
import static org.msgpack.jackson.dataformat.MessagePackDataformatTestBase.Suit;
2525

@@ -40,11 +40,11 @@ public class MessagePackDataformatPojoBenchmarkTest
4040
private static final List<byte[]> pojosSerWithOrig = new ArrayList<byte[]>(LOOP_MAX);
4141
private static final List<byte[]> pojosSerWithMsgPack = new ArrayList<byte[]>(LOOP_MAX);
4242
private final ObjectMapper origObjectMapper = new ObjectMapper();
43-
private final ObjectMapper msgpackObjectMapper = new ObjectMapper(new MessagePackFactory());
43+
private final ObjectMapper msgpackObjectMapper = new ObjectMapper(new MessagePackFormatFactory());
4444

4545
static {
4646
final ObjectMapper origObjectMapper = new ObjectMapper();
47-
final ObjectMapper msgpackObjectMapper = new ObjectMapper(new MessagePackFactory());
47+
final ObjectMapper msgpackObjectMapper = new ObjectMapper(new MessagePackFormatFactory());
4848

4949
for (int i = 0; i < LOOP_MAX; i++) {
5050
NormalPojo pojo = new NormalPojo();

0 commit comments

Comments
 (0)