16bcfbb104
Change-Id: I553dee00f08b8d84c4ba71ffb9dffbe1b262192c Reviewed-on: https://dart-review.googlesource.com/c/90244 Auto-Submit: Danny Tuppeny <dantup@google.com> Commit-Queue: Brian Wilkerson <brianwilkerson@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
67 lines
2.0 KiB
Dart
67 lines
2.0 KiB
Dart
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
// This file has been automatically generated. Please do not edit it manually.
|
|
// To regenerate the file, use the script
|
|
// "pkg/analysis_server/tool/lsp_spec/generate_all.dart".
|
|
|
|
// ignore_for_file: deprecated_member_use
|
|
// ignore_for_file: deprecated_member_use_from_same_package
|
|
// ignore_for_file: unnecessary_brace_in_string_interps
|
|
// ignore_for_file: unused_import
|
|
|
|
import 'dart:core' hide deprecated;
|
|
import 'dart:core' as core show deprecated;
|
|
import 'dart:convert' show JsonEncoder;
|
|
import 'package:analysis_server/lsp_protocol/protocol_special.dart';
|
|
import 'package:analysis_server/src/protocol/protocol_internal.dart'
|
|
show listEqual, mapEqual;
|
|
import 'package:analyzer/src/generated/utilities_general.dart';
|
|
|
|
const jsonEncoder = const JsonEncoder.withIndent(' ');
|
|
|
|
class DartDiagnosticServer implements ToJsonable {
|
|
DartDiagnosticServer(this.port) {
|
|
if (port == null) {
|
|
throw 'port is required but was not provided';
|
|
}
|
|
}
|
|
static DartDiagnosticServer fromJson(Map<String, dynamic> json) {
|
|
final port = json['port'];
|
|
return new DartDiagnosticServer(port);
|
|
}
|
|
|
|
final num port;
|
|
|
|
Map<String, dynamic> toJson() {
|
|
Map<String, dynamic> __result = {};
|
|
__result['port'] = port ?? (throw 'port is required but was not set');
|
|
return __result;
|
|
}
|
|
|
|
static bool canParse(Object obj) {
|
|
return obj is Map<String, dynamic> &&
|
|
obj.containsKey('port') &&
|
|
obj['port'] is num;
|
|
}
|
|
|
|
@override
|
|
bool operator ==(other) {
|
|
if (other is DartDiagnosticServer) {
|
|
return port == other.port && true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
@override
|
|
int get hashCode {
|
|
int hash = 0;
|
|
hash = JenkinsSmiHash.combine(hash, port.hashCode);
|
|
return JenkinsSmiHash.finish(hash);
|
|
}
|
|
|
|
@override
|
|
String toString() => jsonEncoder.convert(toJson());
|
|
}
|