@@ -52,7 +52,7 @@ class IppAttributesGroup(val tag: IppTag) : LinkedHashMap<String, IppAttribute<*
5252
5353 @Suppress(" UNCHECKED_CAST" )
5454 fun <T > getValueOrNull (name : String ): T ? = get(name)?.run {
55- if (tag.` is ValueTag and is not OutOfBandTag ` ()) {
55+ if (tag.isValueTagAndIsNotOutOfBandTag ()) {
5656 if (values.size == 1 ) value as T ?
5757 else {
5858 logger.warning { " For '$name ' one value was expected but found ${values.size} values: $values (ignoring all)" }
@@ -63,19 +63,19 @@ class IppAttributesGroup(val tag: IppTag) : LinkedHashMap<String, IppAttribute<*
6363
6464 @Suppress(" UNCHECKED_CAST" )
6565 fun <T > getValuesOrNull (name : String ): T ? = get(name)?.run {
66- if (tag.` is ValueTag and is not OutOfBandTag ` ()) values as T ?
66+ if (tag.isValueTagAndIsNotOutOfBandTag ()) values as T ?
6767 else null
6868 }
6969
7070 @Suppress(" UNCHECKED_CAST" )
7171 fun <T > getValue (name : String ): T = get(name)?.run {
72- if (tag.` is ValueTag and is not OutOfBandTag ` ()) value as T
72+ if (tag.isValueTagAndIsNotOutOfBandTag ()) value as T
7373 else throw IppException (" '$name ' value is out-of-band: tag=$tag " )
7474 } ? : throwIppAttributeNotFoundException(name)
7575
7676 @Suppress(" UNCHECKED_CAST" )
7777 fun <T > getValues (name : String ): T = get(name)?.run {
78- if (tag.` is ValueTag and is not OutOfBandTag ` ()) values as T
78+ if (tag.isValueTagAndIsNotOutOfBandTag ()) values as T
7979 else throw IppException (" '$name ' values are out-of-band: tag=$tag " )
8080 } ? : throwIppAttributeNotFoundException(name)
8181
@@ -98,8 +98,8 @@ class IppAttributesGroup(val tag: IppTag) : LinkedHashMap<String, IppAttribute<*
9898 private fun throwIppAttributeNotFoundException (attributeName : String ): Nothing =
9999 throw IppAttributeNotFoundException (attributeName, tag)
100100
101- fun `remove attributes where tag is not ValueTag or tag is OutOfBandTag` () = values
102- .filter { ! it.tag.` is ValueTag and is not OutOfBandTag ` () }
101+ fun removeAttributesWhereTagIsNotValueTagOrTagIsOutOfBandTag () = values
102+ .filter { ! it.tag.isValueTagAndIsNotOutOfBandTag () }
103103 .map { remove(it.name) }
104104 .onEach { logger.finer { " $name : Removed attribute $it " } }
105105 .apply { if (isNotEmpty()) logger.fine { " $name : Removed $size attributes ${joinToString(" ," ) { it!! .name }} " } }
0 commit comments