Tabnine Logo
FieldDiffs.toEncodedString
Code IndexAdd Tabnine to your IDE (free)

How to use
toEncodedString
method
in
org.sonar.core.issue.FieldDiffs

Best Java code snippets using org.sonar.core.issue.FieldDiffs.toEncodedString (Showing top 3 results out of 315)

origin: SonarSource/sonarqube

public static IssueChangeDto of(String issueKey, FieldDiffs diffs) {
 IssueChangeDto dto = newDto(issueKey);
 dto.setChangeType(IssueChangeDto.TYPE_FIELD_CHANGE);
 dto.setChangeData(diffs.toEncodedString());
 dto.setUserUuid(diffs.userUuid());
 Date createdAt = requireNonNull(diffs.creationDate(), "Diffs created at must not be null");
 dto.setIssueChangeCreationDate(createdAt.getTime());
 return dto;
}
origin: SonarSource/sonarqube

@Test
public void test_toEncodedString() {
 diffs.setDiff("assignee", "oldAssignee", NAME_WITH_RESERVED_CHARS);
 diffs.setDiff("resolution", "OPEN", "FIXED");
 assertThat(diffs.toEncodedString()).isEqualTo("assignee=oldAssignee|" + ENCODED_NAME_WITH_RESERVED_CHARS + ",resolution=OPEN|FIXED");
}
origin: SonarSource/sonarqube

private static String randomDiffWith(String... fieldsAndValues) {
 Random random = new Random();
 List<Diff> diffs = new ArrayList<>();
 for (int i = 0; i < fieldsAndValues.length; i++) {
  int oldOrNew = random.nextInt(3);
  String value = fieldsAndValues[i + 1];
  diffs.add(new Diff(fieldsAndValues[i], oldOrNew <= 2 ? value : null, oldOrNew >= 2 ? value : null));
  i++;
 }
 IntStream.range(0, random.nextInt(5))
  .forEach(i -> diffs.add(new Diff(randomAlphabetic(10), random.nextBoolean() ? null : randomAlphabetic(11), random.nextBoolean() ? null : randomAlphabetic(12))));
 Collections.shuffle(diffs);
 FieldDiffs res = new FieldDiffs();
 diffs.forEach(diff -> res.setDiff(diff.field, diff.oldValue, diff.newValue));
 return res.toEncodedString();
}
org.sonar.core.issueFieldDiffstoEncodedString

Popular methods of FieldDiffs

  • setCreationDate
  • creationDate
  • diffs
  • setDiff
  • <init>
  • setUserUuid
  • get
  • userUuid
  • parse
  • setIssueKey
  • containsCharToEscape
  • decode
  • containsCharToEscape,
  • decode,
  • decodeField,
  • encodeField,
  • isEncoded,
  • issueKey,
  • serialize,
  • shouldEncode,
  • toString

Popular in Java

  • Making http post requests using okhttp
  • addToBackStack (FragmentTransaction)
  • findViewById (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • JButton (javax.swing)
  • JOptionPane (javax.swing)
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now