Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Unified Diff: components/devtools_bridge/android/java/src/org/chromium/components/devtools_bridge/commands/ParamDefinition.java

Issue 1142463003: Remove devtools_bridge component (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/devtools_bridge/android/java/src/org/chromium/components/devtools_bridge/commands/ParamDefinition.java
diff --git a/components/devtools_bridge/android/java/src/org/chromium/components/devtools_bridge/commands/ParamDefinition.java b/components/devtools_bridge/android/java/src/org/chromium/components/devtools_bridge/commands/ParamDefinition.java
deleted file mode 100644
index 07fd31476af5fac93a4ef01ef73f93d6c6071937..0000000000000000000000000000000000000000
--- a/components/devtools_bridge/android/java/src/org/chromium/components/devtools_bridge/commands/ParamDefinition.java
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package org.chromium.components.devtools_bridge.commands;
-
-import java.util.Map;
-
-/**
- * Desribes in- or out-parameter of a Command.
- * @param <T> Type of the parameter.
- */
-public abstract class ParamDefinition<T> {
- public final String mName;
-
- protected ParamDefinition(String name) {
- mName = name;
- }
-
- public String name() {
- return "_" + mName;
- }
-
- public String type() {
- return "string";
- }
-
- public void checkPresents(Map<String, String> actualParameters) throws CommandFormatException {
- if (!actualParameters.containsKey(name())) {
- throw new CommandFormatException("Missing parameter " + mName);
- }
- }
-
- public T get(Map<String, String> actualParameters) throws CommandFormatException {
- return fromString(actualParameters.get(name()));
- }
-
- public T checkAndGet(Map<String, String> actualParameters) throws CommandFormatException {
- checkPresents(actualParameters);
- return get(actualParameters);
- }
-
- public final void pass(Command.ParamVisitor visitor, T value) {
- visitor.visit(this, toString(value));
- }
-
- protected abstract T fromString(String value) throws CommandFormatException;
- protected abstract String toString(T value);
-}

Powered by Google App Engine
This is Rietveld 408576698