congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Span$TimestampedAnnotation.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
com.nike.wingtips.Span$TimestampedAnnotation
constructor

Best Java code snippets using com.nike.wingtips.Span$TimestampedAnnotation.<init> (Showing top 8 results out of 315)

origin: Nike-Inc/wingtips

protected static List<TimestampedAnnotation> convertToTimestampedAnnotationsList(
  List<JsonDeserializationResult> jdrList
) {
  if (jdrList == null || jdrList.isEmpty()) {
    return null;
  }
  List<TimestampedAnnotation> annotationList = new ArrayList<>(jdrList.size());
  for (JsonDeserializationResult jdr : jdrList) {
    long timestamp = Long.parseLong(jdr.levelOneKeyValuePairs.get(ANNOTATION_SUBOBJECT_TIMESTAMP_FIELD));
    String value = jdr.levelOneKeyValuePairs.get(ANNOTATION_SUBOBJECT_VALUE_FIELD);
    annotationList.add(new TimestampedAnnotation(timestamp, value));
  }
  return annotationList;
}
origin: Nike-Inc/wingtips

@Test
public void TimestampedAnnotation_constructor_works_as_expected() {
  // given
  long timestamp = 42;
  String value = UUID.randomUUID().toString();
  // when
  TimestampedAnnotation result = new TimestampedAnnotation(timestamp, value);
  // then
  assertThat(result.getTimestampEpochMicros()).isEqualTo(timestamp);
  assertThat(result.getValue()).isEqualTo(value);
}
origin: Nike-Inc/wingtips

@Test
public void TimestampedAnnotation_equals_returns_false_and_hashCode_different_if_other_is_not_a_TimestampedAnnotation() {
  // given
  TimestampedAnnotation annotation = new TimestampedAnnotation(42, "foo");
  String notAnAnnotation = "notAnAnnotation";
  // expect
  //noinspection EqualsBetweenInconvertibleTypes
  assertThat(annotation.equals(notAnAnnotation)).isFalse();
  assertThat(annotation.hashCode()).isNotEqualTo(notAnAnnotation.hashCode());
}
origin: Nike-Inc/wingtips

/**
 * A convenience static factory method that serves the same purpose as the
 * {@link TimestampedAnnotation#TimestampedAnnotation(long, String)} constructor.
 *
 * @param timestampEpochMicros The timestamp in epoch microseconds (not milliseconds).
 * @param value The value to associate with the given timestamp.
 * @return A new {@link TimestampedAnnotation} with the given timestamp and value.
 */
public static TimestampedAnnotation forEpochMicros(long timestampEpochMicros, String value) {
  return new TimestampedAnnotation(timestampEpochMicros, value);
}
origin: Nike-Inc/wingtips

@Test
public void TimestampedAnnotation_equals_returns_false_and_hashCode_different_if_timestamp_is_different() {
  // given
  TimestampedAnnotation annotation1 = new TimestampedAnnotation(42, "foo");
  TimestampedAnnotation annotation2 = new TimestampedAnnotation(
    annotation1.getTimestampEpochMicros() + 1234,
    annotation1.getValue()
  );
  // expect
  assertThat(annotation1.equals(annotation2)).isFalse();
  assertThat(annotation1.hashCode()).isNotEqualTo(annotation2.hashCode());
}
origin: Nike-Inc/wingtips

@Test
public void TimestampedAnnotation_equals_returns_true_and_hashCode_same_if_all_fields_are_equal() {
  // given
  TimestampedAnnotation annotation1 = new TimestampedAnnotation(42, "foo");
  TimestampedAnnotation annotation2 = new TimestampedAnnotation(
    annotation1.getTimestampEpochMicros(),
    annotation1.getValue()
  );
  // expect
  assertThat(annotation1.equals(annotation2)).isTrue();
  assertThat(annotation1.hashCode()).isEqualTo(annotation2.hashCode());
}
origin: Nike-Inc/wingtips

@Test
public void TimestampedAnnotation_equals_returns_true_and_hashCode_same_if_same_instance() {
  // given
  TimestampedAnnotation instance = new TimestampedAnnotation(42, "foo");
  // expect
  //noinspection EqualsWithItself
  assertThat(instance.equals(instance)).isTrue();
  assertThat(instance.hashCode()).isEqualTo(instance.hashCode());
}
origin: Nike-Inc/wingtips

@Test
public void TimestampedAnnotation_equals_returns_false_and_hashCode_different_if_value_is_different() {
  // given
  TimestampedAnnotation annotation1 = new TimestampedAnnotation(42, "foo");
  TimestampedAnnotation annotation2 = new TimestampedAnnotation(
    annotation1.getTimestampEpochMicros(),
    annotation1.getValue() + "_nope"
  );
  // expect
  assertThat(annotation1.equals(annotation2)).isFalse();
  assertThat(annotation1.hashCode()).isNotEqualTo(annotation2.hashCode());
}
com.nike.wingtipsSpan$TimestampedAnnotation<init>

Javadoc

Creates a new instance with the given arguments.

NOTE: There are convenience factory methods for creating instances of this class for various use cases:

  • #forEpochMicros(long,String)
  • #forEpochMillis(long,String)
  • #forCurrentTime(String)
  • #forEpochMicrosWithNanoOffset(long,long,String)
See the javadocs on those methods for details.

Popular methods of Span$TimestampedAnnotation

  • getTimestampEpochMicros
  • getValue
  • forEpochMicros
  • forEpochMicrosWithNanoOffset
  • forEpochMillis
    A convenience static factory method that lets you generate an instance of TimestampedAnnotationbased
  • equals
  • forCurrentTime
    A convenience static factory method that lets you generate an instance of TimestampedAnnotationwith
  • hashCode

Popular in Java

  • Start an intent from android
  • getSupportFragmentManager (FragmentActivity)
  • onCreateOptionsMenu (Activity)
  • onRequestPermissionsResult (Fragment)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Top plugins for Android Studio
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