Pojomatic

Automatically provides configurable implementations of the equals(Object), hashCode() and toString() methods inherited from java.lang.Object

Лицензия

Лицензия

Группа

Группа

org.pojomatic
Идентификатор

Идентификатор

pojomatic
Последняя версия

Последняя версия

2.2.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

Pojomatic
Automatically provides configurable implementations of the equals(Object), hashCode() and toString() methods inherited from java.lang.Object
Ссылка на сайт

Ссылка на сайт

http://www.pojomatic.org/pojomatic
Система контроля версий

Система контроля версий

https://github.com/irobertson/pojomatic

Скачать pojomatic

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.pojomatic/pojomatic/ -->
<dependency>
    <groupId>org.pojomatic</groupId>
    <artifactId>pojomatic</artifactId>
    <version>2.2.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.pojomatic/pojomatic/
implementation 'org.pojomatic:pojomatic:2.2.1'
// https://jarcasting.com/artifacts/org.pojomatic/pojomatic/
implementation ("org.pojomatic:pojomatic:2.2.1")
'org.pojomatic:pojomatic:jar:2.2.1'
<dependency org="org.pojomatic" name="pojomatic" rev="2.2.1">
  <artifact name="pojomatic" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.pojomatic', module='pojomatic', version='2.2.1')
)
libraryDependencies += "org.pojomatic" % "pojomatic" % "2.2.1"
[org.pojomatic/pojomatic "2.2.1"]

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
org.ow2.asm : asm jar 7.0

test (4)

Идентификатор библиотеки Тип Версия
org.testng : testng jar 6.9.10
com.google.guava : guava jar 16.0.1
org.mockito : mockito-core jar 2.19.0
org.hamcrest : hamcrest-core jar 1.3

Модули Проекта

Данный проект не имеет модулей.

Pojomatic

Pojomatic provides configurable implementations of the equals(Object), hashCode() and toString() methods inherited from java.lang.Object.

For example, the following bean has been "pojomated":

import org.pojomatic.Pojomatic;
import org.pojomatic.annotations.AutoProperty;

@AutoProperty
public class Person {
  private final String firstName;
  private final String lastName;
  private final int age;

  public Person(String firstName, String lastName, int age) {
    this.firstName = firstName;
    this.lastName = lastName;
    this.age = age;
  }

  public String getFirstName() { return this.firstName; }
  public String getLastName() { return this.lastName; }
  public int getAge() { return this.age; }

  @Override public boolean equals(Object o) {
    return Pojomatic.equals(this, o);
  }

  @Override public int hashCode() {
    return Pojomatic.hashCode(this);
  }

  @Override public String toString() {
    return Pojomatic.toString(this);
  }
}

The above class implements equals and hashCode methods following the best practices outlined in Josh Bloch's Efective Java. Moreover, running

System.out.println(new Person("John", "Doe", 32).toString());

will result in the following output:

Person{firstName: {John}, lastName: {Doe}, age: {32}}

For more information and examples, see the Pojomatic site

Версии библиотеки

Версия
2.2.1
2.2.0
2.1.0
2.0.1
2.0
1.0
1.0-RC3
1.0-RC2
1.0-RC1
0.1