blob: 65716232060a4c4678b22c6abd4bdb2a11c8e3bf [file] [log] [blame]
// Copyright 2018 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import '../../document/value.dart';
import '../../document/values/pos_neg_counter_value.dart';
import '../../sledge_connection_id.dart';
import '../base_type.dart';
/// The Sledge type for positive-negative counter
class IntCounter implements BaseType {
@override
String toJson() => 'IntCounter';
@override
Value newValue(ConnectionId connectionId) =>
new PosNegCounterValue<int>(connectionId.id);
}
/// The Sledge type for positive-negative counter
class DoubleCounter implements BaseType {
@override
String toJson() => 'DoubleCounter';
@override
Value newValue(ConnectionId connectionId) =>
new PosNegCounterValue<double>(connectionId.id);
}