-
Notifications
You must be signed in to change notification settings - Fork 0
/
TTest_intf.pas
45 lines (34 loc) · 908 Bytes
/
TTest_intf.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
unit TTest_intf;
interface
uses
U_fluent_intf;
type
TTestIntfImp = class(TInterfacedObject, ITestIntf)
protected
FName: string;
FAge : Integer;
public
function FluentSetName(Name:string) : ITestIntf;
function FluentSetAge (Age :Integer): ITestIntf;
function Id : ITestIntf;
class function MakeIntf : ITestIntf;
end;
implementation
{ TTestIntfImp }
class function TTestIntfImp.MakeIntf: ITestIntf;
begin
Result := TTestIntfImp.Create as ITestIntf;
end;
function TTestIntfImp.Id : ITestIntf;
begin
Result := Self;
end;
function TTestIntfImp.FluentSetAge(Age: Integer): ITestIntf;
begin
FAge := Age; writeln(age,' '); Result := Self;
end;
function TTestIntfImp.FluentSetName(Name: string): ITestIntf;
begin
FName := Name; write(name,' '); Result := Self;
end;
end.