adapter
This commit is contained in:
parent
605e39e09e
commit
bbc83bd593
|
@ -1,8 +1,8 @@
|
||||||
const adapteeMessage = 'Adaptee#method was called';
|
const adapteeMessage = 'Вызов адаптирующегося метода';
|
||||||
|
|
||||||
class Adaptee {
|
class Adaptee {
|
||||||
String method() {
|
String method() {
|
||||||
print('Adaptee#method is being called');
|
print('Вызов адаптирующегося метода');
|
||||||
|
|
||||||
return adapteeMessage;
|
return adapteeMessage;
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ abstract class Target {
|
||||||
class Adapter implements Target {
|
class Adapter implements Target {
|
||||||
String call() {
|
String call() {
|
||||||
var adaptee = Adaptee();
|
var adaptee = Adaptee();
|
||||||
print('Adapter#call is being called');
|
print('Вызов адаптирующегося метода');
|
||||||
|
|
||||||
return adaptee.method();
|
return adaptee.method();
|
||||||
}
|
}
|
||||||
|
@ -25,5 +25,5 @@ void main() {
|
||||||
var adapter = Adapter();
|
var adapter = Adapter();
|
||||||
var result = adapter.call();
|
var result = adapter.call();
|
||||||
|
|
||||||
assert(result == adapteeMessage);
|
print(result == adapteeMessage);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue