package net.minecraft.launcher.updater;

import com.mojang.launcher.versions.Version;
import java.net.URL;
import java.util.Date;
import net.minecraft.launcher.game.MinecraftReleaseType;

public class PartialVersion implements Version {
   private String id;
   private Date time;
   private Date releaseTime;
   private MinecraftReleaseType type;
   private URL url;

   public PartialVersion() {
   }

   public PartialVersion(String id, Date releaseTime, Date updateTime, MinecraftReleaseType type, URL url) {
      if (id != null && id.length() != 0) {
         if (releaseTime == null) {
            throw new IllegalArgumentException("Release time cannot be null");
         } else if (updateTime == null) {
            throw new IllegalArgumentException("Update time cannot be null");
         } else if (type == null) {
            throw new IllegalArgumentException("Release type cannot be null");
         } else {
            this.id = id;
            this.releaseTime = releaseTime;
            this.time = updateTime;
            this.type = type;
            this.url = url;
         }
      } else {
         throw new IllegalArgumentException("ID cannot be null or empty");
      }
   }

   public String getId() {
      return this.id;
   }

   public MinecraftReleaseType getType() {
      return this.type;
   }

   public Date getUpdatedTime() {
      return this.time;
   }

   public void setUpdatedTime(Date time) {
      if (time == null) {
         throw new IllegalArgumentException("Time cannot be null");
      } else {
         this.time = time;
      }
   }

   public Date getReleaseTime() {
      return this.releaseTime;
   }

   public void setReleaseTime(Date time) {
      if (time == null) {
         throw new IllegalArgumentException("Time cannot be null");
      } else {
         this.releaseTime = time;
      }
   }

   public void setType(MinecraftReleaseType type) {
      if (type == null) {
         throw new IllegalArgumentException("Release type cannot be null");
      } else {
         this.type = type;
      }
   }

   public URL getUrl() {
      return this.url;
   }

   public void setUrl(URL url) {
      this.url = url;
   }

   public String toString() {
      return "PartialVersion{id='" + this.id + '\'' + ", updateTime=" + this.time + ", releaseTime=" + this.releaseTime + ", type=" + this.type + ", url=" + this.url + '}';
   }
}
