package fr.loicdelorme.followUpYourGarden.core.models;

/**
 * This class allow you to create a type of plants.
 * 
 * @author DELORME Loïc
 * @version 1.0.0
 */
public class TypeOfPlants implements Comparable<TypeOfPlants>
{
	/**
	 * The id is unknown.
	 */
	public static final int UNKNOWN_TYPE_OF_PLANTS_ID = -1;

	/**
	 * The id.
	 */
	private final int id;

	/**
	 * The wording.
	 */
	private final String wording;

	/**
	 * Create a type of plants.
	 * 
	 * @param id
	 *            An id.
	 * @param wording
	 *            A wording.
	 */
	public TypeOfPlants(int id, String wording)
	{
		this.id = id;
		this.wording = wording;
	}

	/**
	 * Get the id.
	 * 
	 * @return The id.
	 */
	public int getId()
	{
		return this.id;
	}

	/**
	 * Get the wording.
	 * 
	 * @return The wording.
	 */
	public String getWording()
	{
		return this.wording;
	}

	@Override
	public String toString()
	{
		StringBuilder representation = new StringBuilder();

		representation.append("{id : ").append(this.id).append(", wording : ").append(this.wording).append("}");

		return representation.toString();
	}

	@Override
	public boolean equals(Object object)
	{
		if (this == object)
			return true;

		if (object == null)
			return false;

		if (!(object instanceof TypeOfPlants))
			return false;

		TypeOfPlants typeOfPlants = (TypeOfPlants) object;

		if (this.id != typeOfPlants.id)
			return false;

		if (!this.wording.equals(typeOfPlants.wording))
			return false;

		return true;
	}

	@Override
	public int hashCode()
	{
		return (this.id + this.wording.hashCode());
	}

	@Override
	public int compareTo(TypeOfPlants typeOfPlants)
	{
		return (this.id - typeOfPlants.id);
	}
}

@@ -1239,16 +1239,21 @@
 bject)%0D%0A
+%09%09%7B%0D%0A
 %09%09%09retur
@@ -1260,16 +1260,21 @@
 n true;%0D
+%0A%09%09%7D%0D
 %0A%0D%0A%09%09if 
@@ -1291,16 +1291,21 @@
  null)%0D%0A
+%09%09%7B%0D%0A
 %09%09%09retur
@@ -1305,32 +1305,37 @@
 %09%09return false;%0D
+%0A%09%09%7D%0D
 %0A%0D%0A%09%09if (!(objec
@@ -1359,24 +1359,29 @@
 OfPlants))%0D%0A
+%09%09%7B%0D%0A
 %09%09%09return fa
@@ -1381,24 +1381,29 @@
 turn false;%0D
+%0A%09%09%7D%0D
 %0A%0D%0A%09%09TypeOfP
@@ -1484,16 +1484,21 @@
 ts.id)%0D%0A
+%09%09%7B%0D%0A
 %09%09%09retur
@@ -1502,24 +1502,29 @@
 turn false;%0D
+%0A%09%09%7D%0D
 %0A%0D%0A%09%09if (!th
@@ -1565,16 +1565,21 @@
 ding))%0D%0A
+%09%09%7B%0D%0A
 %09%09%09retur
@@ -1587,16 +1587,21 @@
  false;%0D
+%0A%09%09%7D%0D
 %0A%0D%0A%09%09ret

format code.