選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

Type.java 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Copyright 2011 Vaadin Ltd.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  5. * use this file except in compliance with the License. You may obtain a copy of
  6. * the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  12. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  13. * License for the specific language governing permissions and limitations under
  14. * the License.
  15. */
  16. package com.vaadin.terminal.gwt.client.communication;
  17. public class Type {
  18. private final String baseTypeName;
  19. private final Type[] parameterTypes;
  20. public Type(String baseTypeName, Type[] parameterTypes) {
  21. this.baseTypeName = baseTypeName;
  22. this.parameterTypes = parameterTypes;
  23. }
  24. public String getBaseTypeName() {
  25. return baseTypeName;
  26. }
  27. public Type[] getParameterTypes() {
  28. return parameterTypes;
  29. }
  30. @Override
  31. public String toString() {
  32. String string = baseTypeName;
  33. if (parameterTypes != null) {
  34. string += '<';
  35. for (int i = 0; i < parameterTypes.length; i++) {
  36. if (i != 0) {
  37. string += ',';
  38. }
  39. string += parameterTypes[i].toString();
  40. }
  41. string += '>';
  42. }
  43. return string;
  44. }
  45. }