| 1 |
// Copyright The OpenTelemetry Authors |
| 2 |
// SPDX-License-Identifier: Apache-2.0 |
| 3 |
|
| 4 |
// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. |
| 5 |
// To regenerate this file run "make genpdata". |
| 6 |
|
| 7 |
package pmetric |
| 8 |
|
| 9 |
import ( |
| 10 |
"go.opentelemetry.io/collector/pdata/internal" |
| 11 |
) |
| 12 |
|
| 13 |
// SummaryDataPointValueAtQuantile is a quantile value within a Summary data point. |
| 14 |
// |
| 15 |
// This is a reference type, if passed by value and callee modifies it the |
| 16 |
// caller will see the modification. |
| 17 |
// |
| 18 |
// Must use NewSummaryDataPointValueAtQuantile function to create new instances. |
| 19 |
// Important: zero-initialized instance is not valid for use. |
| 20 |
type SummaryDataPointValueAtQuantile struct { |
| 21 |
orig *internal.SummaryDataPointValueAtQuantile |
| 22 |
state *internal.State |
| 23 |
} |
| 24 |
|
| 25 |
func newSummaryDataPointValueAtQuantile(orig *internal.SummaryDataPointValueAtQuantile, state *internal.State) SummaryDataPointValueAtQuantile { |
| 26 |
return SummaryDataPointValueAtQuantile{orig: orig, state: state} |
| 27 |
} |
| 28 |
|
| 29 |
// NewSummaryDataPointValueAtQuantile creates a new empty SummaryDataPointValueAtQuantile. |
| 30 |
// |
| 31 |
// This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, |
| 32 |
// OR directly access the member if this is embedded in another struct. |
| 33 |
func NewSummaryDataPointValueAtQuantile() SummaryDataPointValueAtQuantile { |
| 34 |
return newSummaryDataPointValueAtQuantile(internal.NewSummaryDataPointValueAtQuantile(), internal.NewState()) |
| 35 |
} |
| 36 |
|
| 37 |
// MoveTo moves all properties from the current struct overriding the destination and |
| 38 |
// resetting the current instance to its zero value |
| 39 |
func (ms SummaryDataPointValueAtQuantile) MoveTo(dest SummaryDataPointValueAtQuantile) { |
| 40 |
ms.state.AssertMutable() |
| 41 |
dest.state.AssertMutable() |
| 42 |
// If they point to the same data, they are the same, nothing to do. |
| 43 |
if ms.orig == dest.orig { |
| 44 |
return |
| 45 |
} |
| 46 |
internal.DeleteSummaryDataPointValueAtQuantile(dest.orig, false) |
| 47 |
*dest.orig, *ms.orig = *ms.orig, *dest.orig |
| 48 |
} |
| 49 |
|
| 50 |
// Quantile returns the quantile associated with this SummaryDataPointValueAtQuantile. |
| 51 |
func (ms SummaryDataPointValueAtQuantile) Quantile() float64 { |
| 52 |
return ms.orig.Quantile |
| 53 |
} |
| 54 |
|
| 55 |
// SetQuantile replaces the quantile associated with this SummaryDataPointValueAtQuantile. |
| 56 |
func (ms SummaryDataPointValueAtQuantile) SetQuantile(v float64) { |
| 57 |
ms.state.AssertMutable() |
| 58 |
ms.orig.Quantile = v |
| 59 |
} |
| 60 |
|
| 61 |
// Value returns the value associated with this SummaryDataPointValueAtQuantile. |
| 62 |
func (ms SummaryDataPointValueAtQuantile) Value() float64 { |
| 63 |
return ms.orig.Value |
| 64 |
} |
| 65 |
|
| 66 |
// SetValue replaces the value associated with this SummaryDataPointValueAtQuantile. |
| 67 |
func (ms SummaryDataPointValueAtQuantile) SetValue(v float64) { |
| 68 |
ms.state.AssertMutable() |
| 69 |
ms.orig.Value = v |
| 70 |
} |
| 71 |
|
| 72 |
// CopyTo copies all properties from the current struct overriding the destination. |
| 73 |
func (ms SummaryDataPointValueAtQuantile) CopyTo(dest SummaryDataPointValueAtQuantile) { |
| 74 |
dest.state.AssertMutable() |
| 75 |
internal.CopySummaryDataPointValueAtQuantile(dest.orig, ms.orig) |
| 76 |
} |