package com.vanillaci.scriptbundles;

import org.codehaus.jackson.annotate.*;
import org.codehaus.jackson.type.*;
import org.jetbrains.annotations.*;

import java.io.*;

/**
 * @author Joel Johnson
 */
public class Manifest implements Serializable {
	public static final TypeReference<Manifest> TYPE_REFERENCE = new TypeReference<Manifest>() {};

	@NotNull private final String name;
	@NotNull private final String version;
	@NotNull private final String main;

	@JsonCreator
	public Manifest(
		@JsonProperty("main") @NotNull String main,
		@JsonProperty("version") @NotNull String version,
		@JsonProperty("name") @NotNull String name
	) {
		this.main = main;
		this.version = version;
		this.name = name;
	}

	@NotNull
	public String getName() {
		return name;
	}

	@NotNull
	public String getVersion() {
		return version;
	}

	@NotNull
	public String getMain() {
		return main;
	}
}

@@ -877,11 +877,535 @@
 main;%0A%09%7D
+%0A%0A%09@Override%0A%09public boolean equals(Object o) %7B%0A%09%09if (this == o) return true;%0A%09%09if (o == null %7C%7C getClass() != o.getClass()) return false;%0A%0A%09%09Manifest manifest = (Manifest) o;%0A%0A%09%09if (!main.equals(manifest.main)) return false;%0A%09%09if (!name.equals(manifest.name)) return false;%0A%09%09if (!version.equals(manifest.version)) return false;%0A%0A%09%09return true;%0A%09%7D%0A%0A%09@Override%0A%09public int hashCode() %7B%0A%09%09int result = name.hashCode();%0A%09%09result = 31 * result + version.hashCode();%0A%09%09result = 31 * result + main.hashCode();%0A%09%09return result;%0A%09%7D
 %0A%7D%0A

give Manifest a reasonable equals/hashcode