From 0577aa44877c3c1aab9ca4c736eb8d50231c5b57 Mon Sep 17 00:00:00 2001 From: "Vitaliy.Bibaev" Date: Tue, 19 Sep 2017 20:40:32 +0300 Subject: [PATCH] Add new generic types types: array, list and map --- .../trace/impl/handler/type/ArrayType.kt | 18 +++++++++++++ .../trace/impl/handler/type/ArrayTypeImpl.kt | 22 ++++++++++++++++ .../trace/impl/handler/type/ListType.kt | 18 +++++++++++++ .../trace/impl/handler/type/ListTypeImpl.kt | 22 ++++++++++++++++ .../trace/impl/handler/type/MapType.kt | 22 ++++++++++++++++ .../trace/impl/handler/type/MapTypeImpl.kt | 25 +++++++++++++++++++ 6 files changed, 127 insertions(+) create mode 100644 plugins/stream-debugger/src/main/java/com/intellij/debugger/streams/trace/impl/handler/type/ArrayType.kt create mode 100644 plugins/stream-debugger/src/main/java/com/intellij/debugger/streams/trace/impl/handler/type/ArrayTypeImpl.kt create mode 100644 plugins/stream-debugger/src/main/java/com/intellij/debugger/streams/trace/impl/handler/type/ListType.kt create mode 100644 plugins/stream-debugger/src/main/java/com/intellij/debugger/streams/trace/impl/handler/type/ListTypeImpl.kt create mode 100644 plugins/stream-debugger/src/main/java/com/intellij/debugger/streams/trace/impl/handler/type/MapType.kt create mode 100644 plugins/stream-debugger/src/main/java/com/intellij/debugger/streams/trace/impl/handler/type/MapTypeImpl.kt diff --git a/plugins/stream-debugger/src/main/java/com/intellij/debugger/streams/trace/impl/handler/type/ArrayType.kt b/plugins/stream-debugger/src/main/java/com/intellij/debugger/streams/trace/impl/handler/type/ArrayType.kt new file mode 100644 index 000000000000..c579988f1627 --- /dev/null +++ b/plugins/stream-debugger/src/main/java/com/intellij/debugger/streams/trace/impl/handler/type/ArrayType.kt @@ -0,0 +1,18 @@ +/* + * Copyright 2000-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.intellij.debugger.streams.trace.impl.handler.type + +interface ArrayType : GenericType.CompositeType \ No newline at end of file diff --git a/plugins/stream-debugger/src/main/java/com/intellij/debugger/streams/trace/impl/handler/type/ArrayTypeImpl.kt b/plugins/stream-debugger/src/main/java/com/intellij/debugger/streams/trace/impl/handler/type/ArrayTypeImpl.kt new file mode 100644 index 000000000000..0ddfb60e44b6 --- /dev/null +++ b/plugins/stream-debugger/src/main/java/com/intellij/debugger/streams/trace/impl/handler/type/ArrayTypeImpl.kt @@ -0,0 +1,22 @@ +/* + * Copyright 2000-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.intellij.debugger.streams.trace.impl.handler.type + +/** + * @author Vitaliy.Bibaev + */ +class ArrayTypeImpl(override val elementType: GenericType, toName: (String) -> String, defaultValue: String) + : ClassTypeImpl(toName.invoke(elementType.variableTypeName), defaultValue), ArrayType diff --git a/plugins/stream-debugger/src/main/java/com/intellij/debugger/streams/trace/impl/handler/type/ListType.kt b/plugins/stream-debugger/src/main/java/com/intellij/debugger/streams/trace/impl/handler/type/ListType.kt new file mode 100644 index 000000000000..caa30205e032 --- /dev/null +++ b/plugins/stream-debugger/src/main/java/com/intellij/debugger/streams/trace/impl/handler/type/ListType.kt @@ -0,0 +1,18 @@ +/* + * Copyright 2000-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.intellij.debugger.streams.trace.impl.handler.type + +interface ListType : GenericType.CompositeType \ No newline at end of file diff --git a/plugins/stream-debugger/src/main/java/com/intellij/debugger/streams/trace/impl/handler/type/ListTypeImpl.kt b/plugins/stream-debugger/src/main/java/com/intellij/debugger/streams/trace/impl/handler/type/ListTypeImpl.kt new file mode 100644 index 000000000000..3b25ad044b77 --- /dev/null +++ b/plugins/stream-debugger/src/main/java/com/intellij/debugger/streams/trace/impl/handler/type/ListTypeImpl.kt @@ -0,0 +1,22 @@ +/* + * Copyright 2000-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.intellij.debugger.streams.trace.impl.handler.type + +/** + * @author Vitaliy.Bibaev + */ +class ListTypeImpl(override val elementType: GenericType, toName: (String) -> String, defaultValue: String) + : ClassTypeImpl(toName.invoke(elementType.genericTypeName), defaultValue), ListType \ No newline at end of file diff --git a/plugins/stream-debugger/src/main/java/com/intellij/debugger/streams/trace/impl/handler/type/MapType.kt b/plugins/stream-debugger/src/main/java/com/intellij/debugger/streams/trace/impl/handler/type/MapType.kt new file mode 100644 index 000000000000..0cf97e3c4983 --- /dev/null +++ b/plugins/stream-debugger/src/main/java/com/intellij/debugger/streams/trace/impl/handler/type/MapType.kt @@ -0,0 +1,22 @@ +/* + * Copyright 2000-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.intellij.debugger.streams.trace.impl.handler.type + +interface MapType : GenericType { + val keyType: GenericType + + val valueType: GenericType +} \ No newline at end of file diff --git a/plugins/stream-debugger/src/main/java/com/intellij/debugger/streams/trace/impl/handler/type/MapTypeImpl.kt b/plugins/stream-debugger/src/main/java/com/intellij/debugger/streams/trace/impl/handler/type/MapTypeImpl.kt new file mode 100644 index 000000000000..002679f07a6c --- /dev/null +++ b/plugins/stream-debugger/src/main/java/com/intellij/debugger/streams/trace/impl/handler/type/MapTypeImpl.kt @@ -0,0 +1,25 @@ +/* + * Copyright 2000-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.intellij.debugger.streams.trace.impl.handler.type + +/** + * @author Vitaliy.Bibaev + */ +class MapTypeImpl(override val keyType: GenericType, + override val valueType: GenericType, + toName: (String, String) -> String, + defaultValue: String) + : ClassTypeImpl(toName.invoke(keyType.genericTypeName, valueType.genericTypeName), defaultValue), MapType