// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package org.jetbrains.idea.svn.conflict;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.api.BaseNodeDescription;
import org.jetbrains.idea.svn.api.NodeKind;
import org.jetbrains.idea.svn.api.Url;

public class ConflictVersion extends BaseNodeDescription {

  private final Url myRepositoryRoot;
  private final String myPath;
  private final long myPegRevision;
  public ConflictVersion(Url repositoryRoot, String path, long pegRevision, @NotNull NodeKind kind) {
    super(kind);
    myRepositoryRoot = repositoryRoot;
    myPath = path;
    myPegRevision = pegRevision;
  }

  public Url getRepositoryRoot() {
    return myRepositoryRoot;
  }

  public String getPath() {
    return myPath;
  }

  public long getPegRevision() {
    return myPegRevision;
  }

  @NotNull
  public NodeKind getKind() {
    return myKind;
  }

  @NotNull
  public String toPresentableString() {
    StringBuilder urlBuilder = new StringBuilder();

    urlBuilder.append(myRepositoryRoot != null ? myRepositoryRoot : "");
    urlBuilder.append("/");
    urlBuilder.append(myPath != null ? myPath : "...");

    return "(" + getKind() + ") " + urlBuilder + "@" + getPegRevision();
  }

  @NotNull
  public static String toPresentableString(@Nullable ConflictVersion version) {
    return version == null ? "" : version.toPresentableString();
  }
}

@@ -18,9 +18,9 @@
 -201
-7
+8
  Jet
@@ -462,16 +462,25 @@
 on %7B%0A%0A  
+@NotNull 
 private 
@@ -505,24 +505,33 @@
 toryRoot;%0A  
+@NotNull 
 private fina
@@ -583,16 +583,17 @@
 vision;%0A
+%0A
   public
@@ -609,16 +609,25 @@
 Version(
+@NotNull 
 Url repo
@@ -637,16 +637,25 @@
 oryRoot,
+ @NotNull
  String 
@@ -813,24 +813,35 @@
 ision;%0A  %7D%0A%0A
+  @NotNull%0A
   public Url
@@ -893,24 +893,35 @@
 yRoot;%0A  %7D%0A%0A
+  @NotNull%0A
   public Str
@@ -1148,105 +1148,39 @@
     
-StringBuilder urlBuilder = new StringBuilder();%0A%0A    urlBuilder.append(myRepositoryRoot != null ?
+return %22(%22 + getKind() + %22) %22 +
  myR
@@ -1197,146 +1197,22 @@
 oot 
-: %22%22);%0A    urlBuilder.append(%22/%22);%0A    urlBuilder.append(myPath != null ? myPath : %22...%22);%0A%0A    return %22(%22 + getKind() + %22) %22 + urlBuilder
++ %22/%22 + myPath
  + %22

Refactor "ConflictVersion", @NotNull