All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.xtext.gradle.idea.tasks.IdeaDistribution Maven / Gradle / Ivy

package org.xtext.gradle.idea.tasks;

import org.eclipse.xtend.lib.annotations.Data;
import org.eclipse.xtend2.lib.StringConcatenation;
import org.eclipse.xtext.xbase.lib.Pure;
import org.eclipse.xtext.xbase.lib.util.ToStringBuilder;

@Data
@SuppressWarnings("all")
public class IdeaDistribution {
  private final String version;
  
  public String getRepository() {
    String _xifexpression = null;
    boolean _isSnapshot = this.isSnapshot();
    if (_isSnapshot) {
      _xifexpression = "snapshots";
    } else {
      _xifexpression = "releases";
    }
    return _xifexpression;
  }
  
  public boolean isSnapshot() {
    return this.version.endsWith("-SNAPSHOT");
  }
  
  public String getContentBaseUrl() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("https://www.jetbrains.com/intellij-repository/");
    String _repository = this.getRepository();
    _builder.append(_repository, "");
    _builder.append("/com/jetbrains/intellij/idea/ideaIC/");
    _builder.append(this.version, "");
    return _builder.toString();
  }
  
  public String getArchiveName() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("ideaIC-");
    _builder.append(this.version, "");
    _builder.append(".zip");
    return _builder.toString();
  }
  
  public String getArchiveUrl() {
    StringConcatenation _builder = new StringConcatenation();
    String _contentBaseUrl = this.getContentBaseUrl();
    _builder.append(_contentBaseUrl, "");
    _builder.append("/");
    String _archiveName = this.getArchiveName();
    _builder.append(_archiveName, "");
    return _builder.toString();
  }
  
  public String getSourceArchiveName() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("ideaIC-");
    _builder.append(this.version, "");
    _builder.append("-sources.jar");
    return _builder.toString();
  }
  
  public String getSourceArchiveUrl() {
    StringConcatenation _builder = new StringConcatenation();
    String _contentBaseUrl = this.getContentBaseUrl();
    _builder.append(_contentBaseUrl, "");
    _builder.append("/");
    String _sourceArchiveName = this.getSourceArchiveName();
    _builder.append(_sourceArchiveName, "");
    return _builder.toString();
  }
  
  public IdeaDistribution(final String version) {
    super();
    this.version = version;
  }
  
  @Override
  @Pure
  public int hashCode() {
    final int prime = 31;
    int result = 1;
    result = prime * result + ((this.version== null) ? 0 : this.version.hashCode());
    return result;
  }
  
  @Override
  @Pure
  public boolean equals(final Object obj) {
    if (this == obj)
      return true;
    if (obj == null)
      return false;
    if (getClass() != obj.getClass())
      return false;
    IdeaDistribution other = (IdeaDistribution) obj;
    if (this.version == null) {
      if (other.version != null)
        return false;
    } else if (!this.version.equals(other.version))
      return false;
    return true;
  }
  
  @Override
  @Pure
  public String toString() {
    ToStringBuilder b = new ToStringBuilder(this);
    b.add("version", this.version);
    return b.toString();
  }
  
  @Pure
  public String getVersion() {
    return this.version;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy